クラス DefaultErrorAttributes
java.lang.ObjectSE
org.springframework.boot.webmvc.error.DefaultErrorAttributes
- 実装済みのインターフェース一覧:
ErrorAttributes, Ordered, HandlerExceptionResolver
@Order(-2147483648)
public class DefaultErrorAttributes
extends ObjectSE
implements ErrorAttributes, HandlerExceptionResolver, Ordered
ErrorAttributes のデフォルト実装。可能な場合、次の属性を提供します。- timestamp - エラーが抽出された時間
- status - 状態コード
- error - エラーの理由
- exception - ルート例外のクラス名 (設定されている場合)
- message - 例外メッセージ (設定されている場合)
- errors -
BindingResultまたはMethodValidationResult例外(設定されている場合)に起因する検証エラー。JSON への安全な直列化を保証するため、エラーはwrapped if necessaryです。 - trace - 例外スタックトレース (設定されている場合)
- path - 例外が発生したときの URL パス
- 導入:
- 4.0.0
- 作成者:
- Phillip Webb, Dave Syer, Stephane Nicoll, Vedran Pavic, Scott Frederick, Moritz Halbritter, Yanming Zhou, Yongjun Hong
- 関連事項:
フィールド概要
インターフェース Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明@Nullable ThrowableSEgetError(WebRequest webRequest) エラーの根本的な原因を返すか、エラーを抽出できない場合はnullを返します。getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) エラー属性のMapSE を返します。protected StringSEgetMessage(WebRequest webRequest, @Nullable ThrowableSE error) messageエラー属性の値として含まれるメッセージを返します。intgetOrder()@Nullable ModelAndViewresolveException(HttpServletRequestEE request, HttpServletResponseEE response, @Nullable ObjectSE handler, ExceptionSE ex)
コンストラクターの詳細
DefaultErrorAttributes
public DefaultErrorAttributes()
メソッドの詳細
getOrder
resolveException
public @Nullable ModelAndView resolveException(HttpServletRequestEE request, HttpServletResponseEE response, @Nullable ObjectSE handler, ExceptionSE ex) - 次で指定:
- インターフェース
HandlerExceptionResolverのresolveException
getErrorAttributes
public MapSE<StringSE, @Nullable ObjectSE> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) インターフェースからコピーされた説明:ErrorAttributes- 次で指定:
- インターフェース
ErrorAttributesのgetErrorAttributes - パラメーター:
webRequest- ソースリクエストoptions- エラー属性コンテンツのオプション- 戻り値:
- エラー属性のマップ
getMessage
messageエラー属性の値として含まれるメッセージを返します。デフォルトでは、返されるメッセージは空ではない次の最初のものです。RequestDispatcher.ERROR_MESSAGEEE リクエスト属性の値。- 与えられた
errorのメッセージ。 No message available.
- パラメーター:
webRequest- 現在のリクエストerror- 現在のエラー(ある場合)- 戻り値:
- エラー属性に含めるメッセージ
getError
インターフェースからコピーされた説明:ErrorAttributesエラーの根本的な原因を返すか、エラーを抽出できない場合はnullを返します。- 次で指定:
- インターフェース
ErrorAttributesのgetError - パラメーター:
webRequest- ソースリクエスト- 戻り値:
- エラーまたは
nullの原因となったExceptionSE