Revision 7468 trunk/extensions/extWCS/src/com/iver/cit/gvsig/fmap/layers/FLyrWCS.java

View differences:

FLyrWCS.java
75 75
import org.gvsig.remoteClient.wms.ICancellable;
76 76

  
77 77
import com.iver.andami.PluginServices;
78
import com.iver.cit.gvsig.fmap.ConnectionErrorExceptionType;
78 79
import com.iver.cit.gvsig.fmap.DriverException;
80
import com.iver.cit.gvsig.fmap.UnknownResponseFormatExceptionType;
81
import com.iver.cit.gvsig.fmap.UnsuportedProtocolVersionExceptionType;
79 82
import com.iver.cit.gvsig.fmap.ViewPort;
83
import com.iver.cit.gvsig.fmap.WCSDriverExceptionType;
80 84
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
81 85
import com.iver.cit.gvsig.fmap.drivers.UnsupportedVersionException;
82 86
import com.iver.cit.gvsig.fmap.drivers.wcs.FMapWCSDriver;
......
576 580
			rasterProcess(g, vpData, f);
577 581

  
578 582
		} catch (ValidationException e) {
579
			throw new DriverException(PluginServices.getText(this, "unknown_response_format"), e);
580
		} catch (UnsupportedVersionException e) {
581
			throw new DriverException(PluginServices.getText(this, "version_conflict"), e);
583
			UnknownResponseFormatExceptionType type = 
584
				new UnknownResponseFormatExceptionType();
585
			type.setLayerName(getName());
586
			try {
587
				type.setDriverName(getDriver().getName());
588
			} catch (Exception e1) {
589
				e1.printStackTrace();
590
			}
591
			type.setFormat(format);
592
			type.setHost(host);
593
			type.setProtocol("WCS");
594
			DriverException exception = new DriverException("unknown_response_format", type);
595
			throw exception;
596
//	azabala		throw new DriverException(PluginServices.getText(this, "unknown_response_format"), e);
597
		}
598
		catch (UnsupportedVersionException e) {
599
			UnsuportedProtocolVersionExceptionType type = 
600
				new UnsuportedProtocolVersionExceptionType();
601
			type.setLayerName(getName());
602
			try {
603
				type.setDriverName(getDriver().getName());
604
			} catch (Exception ex){	
605
			}
606
			type.setUrl(host);
607
			throw new DriverException(PluginServices.getText(this, "version_conflict"), e, type);
608
			
609
//	azabala		throw new DriverException(PluginServices.getText(this, "version_conflict"), e);
582 610
		} catch (IOException e) {
583
			throw new DriverException(PluginServices.getText(this, "connect_error"), e);
611
			ConnectionErrorExceptionType type = new ConnectionErrorExceptionType();
612
			type.setLayerName(getName());
613
			try {
614
				type.setDriverName(getDriver().getName());
615
			} catch (Exception e1) {
616
			} 
617
			type.setHost(host);
618
			throw new DriverException(PluginServices.
619
					getText(this, "connect_error"), e, type);
584 620
		} catch (WCSException e) {
585
            JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), e.getMessage());
586
            this.setVisible(false);
587
        }
621
//azabala: la capturamos y la convertimos en DriverException
622
			WCSDriverExceptionType type = new WCSDriverExceptionType();
623
			type.setLayerName(getName());
624
			try {
625
				type.setDriverName(getDriver().getName());
626
			} catch (Exception e1) {
627
			} 
628
			type.setWcsStatus(wcsStatus);
629
			this.setVisible(false);
630
			throw new DriverException("Error WCS", e,  type);
631
			
632
//            JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(), e.getMessage());
633
            
634
        }//catch
588 635
	}
589 636

  
590 637
	/**

Also available in: Unified diff