Objet d'erreur. Il peut s'agir d'un objet Error (par exemple, si un
Error a été généré dans un gestionnaire d'événements) ou un objet avec une erreur
(par exemple, si le destinataire reçoit une commande non valide).
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003e\u003ccode\u003ecast.framework.events.ErrorEvent\u003c/code\u003e provides data for errors occurring within the Cast framework.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003edetailedErrorCode\u003c/code\u003e, \u003ccode\u003eerror\u003c/code\u003e, \u003ccode\u003ereason\u003c/code\u003e, and \u003ccode\u003eseverity\u003c/code\u003e for detailed error information.\u003c/p\u003e\n"],["\u003cp\u003eThese properties help developers understand the cause and severity of errors, aiding in debugging and error handling.\u003c/p\u003e\n"],["\u003cp\u003eConstructor parameters allow for setting these properties when creating a new \u003ccode\u003eErrorEvent\u003c/code\u003e instance.\u003c/p\u003e\n"]]],["The `ErrorEvent` class provides data for `ERROR` events within the cast framework. It's constructed with optional parameters: `detailedErrorCode`, `error` (an object or Error), `reason`, and `severity`. Its properties include the `detailedErrorCode` (identifying the error's cause), the `error` object (either an Error instance or an object with error info), `reason` (the error's reason), and `severity` (the error's level of importance). These elements allow for comprehensive error reporting.\n"],null,["# Class: ErrorEvent\n\ncast.[framework](/cast/docs/reference/web_receiver/cast.framework).[events](/cast/docs/reference/web_receiver/cast.framework.events).ErrorEvent\n===============================================================================================================================================\n\nclass static\n\nEvent data for a `cast.framework.events.EventType.ERROR` event.\n\nConstructor\n-----------\n\n### ErrorEvent\n\nnew\nErrorEvent(detailedErrorCode, error, reason, severity)\n\n| #### Parameter ||\n|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| detailedErrorCode | Optional [cast.framework.events.DetailedErrorCode](/cast/docs/reference/web_receiver/cast.framework.events#.DetailedErrorCode) Value must not be null. |\n| error | Optional Object Value must not be null. |\n| reason | Optional [cast.framework.messages.ErrorReason](/cast/docs/reference/web_receiver/cast.framework.messages#.ErrorReason) Value must not be null. |\n| severity | Optional [cast.framework.events.ErrorSeverity](/cast/docs/reference/web_receiver/cast.framework.events#.ErrorSeverity) Value must not be null. |\n\nProperties\n----------\n\n### detailedErrorCode\n\nconstant\n\n(non-null [cast.framework.events.DetailedErrorCode](/cast/docs/reference/web_receiver/cast.framework.events#.DetailedErrorCode) or undefined)\n\nAn error code representing the cause of the error.\n\n### error\n\nconstant\n\n(non-null Error, non-null Object, or undefined)\n\nThe error object. This could be an `Error` object (for example, if an\n`Error` was thrown in an event handler) or an object with error\ninformation (for example, if the receiver received an invalid command).\n\n### reason\n\n(non-null [cast.framework.messages.ErrorReason](/cast/docs/reference/web_receiver/cast.framework.messages#.ErrorReason) or undefined)\n\nOptional error reason.\n\n### severity\n\n(non-null [cast.framework.events.ErrorSeverity](/cast/docs/reference/web_receiver/cast.framework.events#.ErrorSeverity) or undefined)\n\nOptional error severity."]]