Page MenuHomeSoftware Heritage

In case of errors, return a simple dictionary instead of pickled exception.
ClosedPublic

Authored by vlorentz on Feb 5 2020, 5:12 PM.

Details

Summary

Pros:

  • Language-independent
  • Works with unpickleable exceptions (eg. cimpl.KafkaException, and RLock objects in exceptions raised by tenacity)

Con:

  • Shows a less nice error on the client side (if the client is in Python)

Resolves T2239.

Test Plan

tox passes this repo, but I'm going to try tests with RPC servers that use it.

Diff Detail

Repository
rDCORE Foundations and core functionalities
Branch
error-no-pickle
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10588
Build 15811: tox-on-jenkinsJenkins
Build 15810: arc lint + arc unit

Event Timeline

but I'm going to try tests with RPC servers that use it.

Meh. Of course it doesn't.

starts to look, better ;)

swh/core/api/__init__.py
97

is self.args systematically a list?

284

unsure about removing that statement.
i guess that's the price for not having tests on that part ;)

This revision is now accepted and ready to land.Feb 6 2020, 12:07 PM
swh/core/api/__init__.py
97

It's a tuple, but yes

284

It's a bad idea to return None in case an endpoint doesn't exist, anyway.

Note: this diff will stay open for a little while, @ardumont and I have other changes to make before it can be merged

Update RPCClient to re-raise whitelisted exceptions types.

This revision was landed with ongoing or failed builds.Feb 14 2020, 12:22 PM
This revision was automatically updated to reflect the committed changes.