-package org.simantics.databoard.channel;\r
-\r
-import org.simantics.databoard.adapter.AdaptException;\r
-import org.simantics.databoard.binding.Binding;\r
-import org.simantics.databoard.binding.error.BindingException;\r
-import org.simantics.databoard.binding.mutable.Variant;\r
-\r
-/**\r
- * Service exception is a problem in processing the service request.\r
- * It is produces by Service Handler. Service Exception is not a communication \r
- * error. \r
- *\r
- * @author Toni Kalajainen <toni.kalajainen@iki.fi>\r
- */\r
-public abstract class ServiceException extends Exception {\r
-\r
- private static final long serialVersionUID = 1L;\r
-\r
- Variant error;\r
- \r
- public ServiceException(Variant error) {\r
- this.error = error;\r
- }\r
- \r
- public ServiceException(Binding binding, Object value) {\r
- error = new Variant(binding, value);\r
- }\r
- \r
- public Variant getError() {\r
- return error;\r
- }\r
- \r
- public Object getErrorType() {\r
- return error.type();\r
- }\r
- \r
- public Object getError(Binding binding) throws BindingException {\r
- try {\r
- return error.getValue(binding);\r
- } catch (AdaptException e) {\r
- if (e.getCause()!=null && e.getCause() instanceof BindingException) throw (BindingException) e.getCause();\r
- throw new BindingException(e);\r
- }\r
- }\r
- \r
-}\r
+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 <toni.kalajainen@iki.fi>
+ */
+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);
+ }
+ }
+
+}