X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fchannel%2FServiceException.java;h=2c78a92373a815ab354d6f76d31d1347d0e6ef7b;hb=refs%2Fchanges%2F38%2F238%2F2;hp=c4a8854c26c7d87020af0acfa975a1b4406913aa;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/ServiceException.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/ServiceException.java index c4a8854c2..2c78a9237 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/ServiceException.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/channel/ServiceException.java @@ -1,46 +1,46 @@ -package org.simantics.databoard.channel; - -import org.simantics.databoard.adapter.AdaptException; -import org.simantics.databoard.binding.Binding; -import org.simantics.databoard.binding.error.BindingException; -import org.simantics.databoard.binding.mutable.Variant; - -/** - * Service exception is a problem in processing the service request. - * It is produces by Service Handler. Service Exception is not a communication - * error. - * - * @author Toni Kalajainen - */ -public abstract class ServiceException extends Exception { - - private static final long serialVersionUID = 1L; - - Variant error; - - public ServiceException(Variant error) { - this.error = error; - } - - public ServiceException(Binding binding, Object value) { - error = new Variant(binding, value); - } - - public Variant getError() { - return error; - } - - public Object getErrorType() { - return error.type(); - } - - public Object getError(Binding binding) throws BindingException { - try { - return error.getValue(binding); - } catch (AdaptException e) { - if (e.getCause()!=null && e.getCause() instanceof BindingException) throw (BindingException) e.getCause(); - throw new BindingException(e); - } - } - -} +package org.simantics.databoard.channel; + +import org.simantics.databoard.adapter.AdaptException; +import org.simantics.databoard.binding.Binding; +import org.simantics.databoard.binding.error.BindingException; +import org.simantics.databoard.binding.mutable.Variant; + +/** + * Service exception is a problem in processing the service request. + * It is produces by Service Handler. Service Exception is not a communication + * error. + * + * @author Toni Kalajainen + */ +public abstract class ServiceException extends Exception { + + private static final long serialVersionUID = 1L; + + Variant error; + + public ServiceException(Variant error) { + this.error = error; + } + + public ServiceException(Binding binding, Object value) { + error = new Variant(binding, value); + } + + public Variant getError() { + return error; + } + + public Object getErrorType() { + return error.type(); + } + + public Object getError(Binding binding) throws BindingException { + try { + return error.getValue(binding); + } catch (AdaptException e) { + if (e.getCause()!=null && e.getCause() instanceof BindingException) throw (BindingException) e.getCause(); + throw new BindingException(e); + } + } + +}