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

ubus: various improvements #104

Merged
merged 2 commits into from
Sep 9, 2022
Merged

ubus: various improvements #104

merged 2 commits into from
Sep 9, 2022

Conversation

jow-
Copy link
Owner

@jow- jow- commented Sep 9, 2022

  • Support obtaining the raw numerical error code by passing a truish value to error()
  • Add constants for known ubus error codes to the toplevel module scope

jow- added 2 commits September 9, 2022 14:23
Add constants for ubus status codes to the toplevel module scope in order
to avoid the need for magic values in the code.

Suggested-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Some ubus users require access to the original ubus error status returned
by various operations for fine grained error handling.

Extend the error() function with an optional boolean argument which causes
the function to return the numeric error code instead of a preformatted
message when invoked.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
@jow- jow- force-pushed the ubus-improvements branch from 4173e31 to cc4eb79 Compare September 9, 2022 12:23
@jow- jow- changed the title ubus: allow object method call handlers to return a numeric status code ubus: various improvements Sep 9, 2022
@jow- jow- merged commit 7fa59ce into master Sep 9, 2022
@jow- jow- deleted the ubus-improvements branch September 9, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant