/// <summary> /// Constructs a new instance of the DSSExceptionWrapper. /// </summary> /// <param name="exception">The DSSException instance to be wrapped.</param> /// <param name="innerException">An optional inner exception.</param> public DSSExceptionWrapper(DSSException exception, Exception innerException) : base(exception.GetMessage(), innerException) { if (exception == null) { throw new ArgumentNullException("exception"); } Exception = exception; }
private static HttpStatusCode GetHttpStatusCode(DSSException e) { switch (e.GetType().Name) { case "UnsupportedLanguageException" : return HttpStatusCode.BadRequest; case "UnrecognizedTraitCriterionException" : return HttpStatusCode.BadRequest; case "UnrecognizedScopingEntityException" : return HttpStatusCode.BadRequest; case "UnrecognizedScopedEntityException" : return HttpStatusCode.BadRequest; case "UnrecognizedLanguageException" : return HttpStatusCode.BadRequest; case "RequiredDataNotProvidedException" : return HttpStatusCode.BadRequest; case "InvalidTimeZoneOffsetException" : return HttpStatusCode.BadRequest; case "InvalidDataFormatException" : return HttpStatusCode.BadRequest; case "InvalidTraitCriterionDataFormatException" : return HttpStatusCode.BadRequest; case "InvalidDriDataFormatException" : return HttpStatusCode.BadRequest; case "EvaluationException" : return HttpStatusCode.InternalServerError; case "DSSRuntimeException" : return HttpStatusCode.InternalServerError; default : return HttpStatusCode.InternalServerError; } }
/// <summary> /// Constructs a new instance of the DSSExceptionWrapper. /// </summary> /// <param name="exception">The DSSException instance to be wrapped.</param> public DSSExceptionWrapper(DSSException exception) : this(exception, null) { }