error: add format string usage to compose a CustomError message
For the CustomError the ability to create a message using a format string was added. Closes #4903 @TarantoolBot document Title: Add format string usage to compose a CustomError message When an error created using the separate members mode (box.error(code, errtext[, errtext ...])) in the case of ClientError error creation, a pre-defined format is used (corresponding to the error code) (nothing has changed), in the case of CustomError error creation, a format string can be used to compose a message. ClientError(nothing has changed): ```Lua box.error(code, reason args) ``` Example for ER_CREATE_SPACE: ```Lua box.error(9, "my_space", "reason") ``` Result: ```Lua error: 'Failed to create space ''my_space'': reason' ``` CustomError: ```Lua box.error(type, reason format string, reason args) ``` Example: ```Lua box.error("MyCustomType", "The error reason: %s", "some error reason") ``` Result: ```Lua error: 'The error reason: some error reason' ```
Loading
Please register or sign in to comment