ImageMagick.MagickExceptionHelper.CreateException C# (CSharp) Method

CreateException() private static method

private static CreateException ( IntPtr exception ) : MagickException
exception System.IntPtr
return MagickException
    private static MagickException CreateException(IntPtr exception)
    {
      ExceptionSeverity severity = (ExceptionSeverity)NativeMagickExceptionHelper.Severity(exception);
      string message = NativeMagickExceptionHelper.Message(exception);
      string description = NativeMagickExceptionHelper.Description(exception);

      if (!string.IsNullOrEmpty(description))
        message += " (" + description + ")";

      List<MagickException> innerExceptions = CreateRelatedExceptions(exception);
      MagickException innerException = innerExceptions.Count > 0 ? innerExceptions[0] : null;

      MagickException result = Create(severity, message, innerException);
      result.SetRelatedException(innerExceptions);

      return result;
    }