私は、ASP.NET MVCのアクションメソッド投げる例外はASP.NET MVCで内部例外を表示
throw new Exception("outer", new SecurityException("inner"));
実際に死の黄色の画面上に表示されるエラーに次の行を追加する場合外側の例外についてはまったく言及していない内部のSecurityExceptionです。
SecurityException
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: inner
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: inner]
この現象は予期しないものですか?
外部例外がどのようなタイプであるかは問題ではないようです。別のSecurityExceptionであっても、メッセージは決して表示されません。デフォルトのSecurityExceptionエラーメッセージはあまりにも曖昧で、私はそれをキャッチして、より具体的な情報を追加したい。元のSecurityExceptionをinnerExceptionとして含めるのではなく、これを行うのが理想的です。
私はこれがsecurityexceptionだけでなく、あらゆる内部例外に対して当てはまることを見ています。 –