Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain target property in errors, link to UI5 OData model #946

Merged
merged 4 commits into from
May 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions node.js/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ if (req.errors) //> get out somehow...
- `target` _String (Optional)_ - The name of an input field/element a message is related to.
- `args` _Array (Optional)_ - Array of placeholder values. See [Localized Messages](cds-i18n) for details.

::: warning :::
renejeglinsky marked this conversation as resolved.
Show resolved Hide resolved
The `target` property is evaluated by the UI5 OData model and needs to be set according to the [documentation](https://ui5.sap.com/#/topic/fbe1cb5613cf4a40a841750bf813238e).
renejeglinsky marked this conversation as resolved.
Show resolved Hide resolved
:::


#### <i> Using an Object as Argument </i>

You can also pass an object as the sole argument, which then contains the properties `code`, `message`, `target`, and `args`. Additional properties are preserved until the error or message is sanitized for the client. In case of an error, the additional property `status` can be used to specify the HTTP status code of the response.
Expand Down
Loading