code: public ApplicationException wrap(Throwable cause) {
  		if (cause instanceof ApplicationException)
  			return (ApplicationException) cause;
  
  		this.withCause(cause);
  		return this;
  	}
docs: Wraps another exception into an application exception object.
  
  If original exception is of ApplicationException type it is returned without
  changes. Otherwise a new ApplicationException is created and original error
  is set as its cause.
  
  @param cause an original error object
  @return an original or newly created ApplicationException