The Wayback Machine - https://web.archive.org/web/20220408080137/https://github.com/eXist-db/exist/issues/3275
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

[feature] consolidate error message for Array out of bounds exception #3275

Open
line-o opened this issue Mar 4, 2020 · 1 comment
Open

[feature] consolidate error message for Array out of bounds exception #3275

line-o opened this issue Mar 4, 2020 · 1 comment
Labels
enhancement good first issue xquery

Comments

@line-o
Copy link
Member

@line-o line-o commented Mar 4, 2020

Is your feature request related to a problem? Please describe.

Running the code below will result in two different error messages:

xquery version "3.1";

try { [1,2,3,4](-1) } catch err:FOAY0001 { $err:description },
try { array:get([1,2,3,4], -1) } catch err:FOAY0001 { $err:description }
  • "Array index out of bounds. Position -1 does not exist in this array. Length is 4"
  • "Array index out of bounds. Array index -1 out of bounds (1..4)"

Describe the solution you'd like
I would like to see both error messages to be consistent.

Describe alternatives you've considered
Alternatively, the second of the error descriptions could mention that a call to array:get was the reason.

@line-o line-o added the enhancement label Mar 4, 2020
@adamretter
Copy link
Member

@adamretter adamretter commented Mar 23, 2020

@line-o please feel free to send a PR

@line-o line-o added xquery good first issue labels Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue xquery
2 participants