package com.airlock.iam.servicecontainer.app.infrastructure.webapp.model;

import com.airlock.iam.servicecontainer.app.infrastructure.webapp.util.ErrorMessage;
import com.airlock.iam.servicecontainer.app.infrastructure.webapp.view.ErrorView;
import com.vaadin.navigator.View;

public abstract class ServiceContainerException extends Exception {
   public ServiceContainerException(String message, Throwable t) {
      super(message, t);
   }

   public ServiceContainerException(String message) {
      super(message);
   }

   public View getErrorView() {
      return new ErrorView(new ErrorMessage(this.getCaption(), this.getDescription()));
   }

   protected abstract ErrorMessage.ErrorCaption getCaption();

   protected abstract ErrorMessage.ErrorDescription getDescription();
}
