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

ISOStringFieldPackager throws an IndexOutOfBoundsException #150

Open
MouslihAbdelhakim opened this issue Feb 7, 2018 · 1 comment
Open

Comments

@MouslihAbdelhakim
Copy link
Contributor

Hello,

While Unpacking a DE with IFE_LLLCHAR today this exception was thrown

Exception in thread "main" org.jpos.iso.ISOException: org.jpos.iso.IFE_LLLCHAR: Problem unpacking field 61 (java.lang.IndexOutOfBoundsException) unpacking field=61, consumed=241

After some investigating, it turned out that the DE value was signaling that it has a length of a 100 but in reality it was only 26 bytes in length.

Since java.lang.IndexOutOfBoundsException does not tell us much, i think that it would be useful if ISOStringFieldPackager compared how many bytes are still array to how much it is expecting to extract and threw a more comprehensive error message like :

Trying to extract X bytes but the message contains only Y bytes

I will gladly work on this issue if the JPos project accepts PRs.

kind regards.

@ar
Copy link
Member

ar commented Feb 7, 2018

Anything that saves us debugging time with this kind of very common issues while configuring new endpoints is welcome, so please go ahead with the PR at your convenience.

MouslihAbdelhakim added a commit to MouslihAbdelhakim/jPOS that referenced this issue Feb 19, 2018
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

No branches or pull requests

2 participants