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

Wrap SerializationException thrown on store internal method #75

Open
tuhuynh27 opened this issue Dec 15, 2021 · 0 comments
Open

Wrap SerializationException thrown on store internal method #75

tuhuynh27 opened this issue Dec 15, 2021 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@tuhuynh27
Copy link
Member

Currently we have code like this:

try {
            byte[] value = chronicleMap.get(key);
            LinkedList<BytesValue> list;
            list = value == null ? new LinkedList<>() : SerializationUtils.deserialize(value); // <- can throw
            for (byte[] v : values) {
                list.addFirst(new BytesValue(v));
            }
            chronicleMap.put(key, SerializationUtils.serialize(list)); // <- can throw
            return list.size();
        } finally {
            lock.unlock();
        }

From 2 places the same exception can be thrown but only 1 of them indicates client error.
Should create try/catch and wrap the thrown exception.

Related to #74

@tuhuynh27 tuhuynh27 added the help wanted Extra attention is needed label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant