1 package org.simantics.databoard.channel;
3 import org.simantics.databoard.adapter.AdaptException;
4 import org.simantics.databoard.binding.Binding;
5 import org.simantics.databoard.binding.error.BindingException;
6 import org.simantics.databoard.binding.mutable.Variant;
9 * Service exception is a problem in processing the service request.
10 * It is produces by Service Handler. Service Exception is not a communication
13 * @author Toni Kalajainen <toni.kalajainen@iki.fi>
15 public abstract class ServiceException extends Exception {
17 private static final long serialVersionUID = 1L;
21 public ServiceException(Variant error) {
25 public ServiceException(Binding binding, Object value) {
26 error = new Variant(binding, value);
29 public Variant getError() {
33 public Object getErrorType() {
37 public Object getError(Binding binding) throws BindingException {
39 return error.getValue(binding);
40 } catch (AdaptException e) {
41 if (e.getCause()!=null && e.getCause() instanceof BindingException) throw (BindingException) e.getCause();
42 throw new BindingException(e);