fix: convert errors, return error from match_cmp_type#14
Open
Shawermik wants to merge 3 commits intofix-type-conversionfrom
Open
fix: convert errors, return error from match_cmp_type#14Shawermik wants to merge 3 commits intofix-type-conversionfrom
Shawermik wants to merge 3 commits intofix-type-conversionfrom
Conversation
alrsorokin
reviewed
Feb 2, 2026
jsonpath.lua
Outdated
| return jsonpath | ||
| end)() | ||
|
|
||
| local function Bad_request_error(err) |
jsonpath.lua
Outdated
|
|
||
| local function Bad_request_error(err) | ||
| local err = JsonPathError:new(err) | ||
| err.rc = codes.BAD_REQUEST |
jsonpath.lua
Outdated
| if type(obj) ~= "table" then | ||
| return nil, 'object is primitive' | ||
| local err = JsonPathNotFoundError:new('object is primitive') | ||
| err.rc = codes.NOT_FOUND |
Collaborator
There was a problem hiding this comment.
тогда и для всех остальных ошибок хелперы бы завести
jsonpath.lua
Outdated
| local M = {} | ||
|
|
||
| local codes = { | ||
| SUCCESS = 200, |
Collaborator
There was a problem hiding this comment.
SUCCESS - не используется
alrsorokin
approved these changes
Feb 4, 2026
Collaborator
alrsorokin
left a comment
There was a problem hiding this comment.
пробегись по всему коду где ошибка кладется сначала в переменную
|
|
||
| return nil, 'no element matching expression' | ||
| local err = bad_request_error('no element matching expression') | ||
| return nil, err |
Collaborator
There was a problem hiding this comment.
return nil, bad_request_error('no element matching expression')| if count ~= nil and type(count) ~= 'number' then | ||
| return nil, "invalid 'count' argument" | ||
| local err = bad_request_error("invalid 'count' argument") | ||
| return nil, err |
Collaborator
There was a problem hiding this comment.
return nil, bad_request_error("invalid 'count' argument")| if expr == nil or (type(expr) ~= 'string' and type(expr) ~= 'table') then | ||
| return nil, "missing or invalid 'expr' argument" | ||
| local err = bad_request_error("missing or invalid 'expr' argument") | ||
| return nil, err |
Collaborator
There was a problem hiding this comment.
return nil, bad_request_error("missing or invalid 'expr' argument")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.