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

Remove Generic Exceptions #1428

Closed
ehennenfent opened this issue May 6, 2019 · 1 comment
Closed

Remove Generic Exceptions #1428

ehennenfent opened this issue May 6, 2019 · 1 comment

Comments

@ehennenfent
Copy link
Contributor

We use raise Exception in 47 different places. Not all of those are in unit tests. As a general rule, we should change these to more-specific exceptions so that it's easier to catch specific issues.

disconnect3d pushed a commit that referenced this issue Oct 18, 2019
* Use more specific exception types when raising exceptions (#1428)

* Reformatted code using Black

* Leave imports at the beginning of the file
@disconnect3d
Copy link
Member

disconnect3d commented Oct 18, 2019

There are only 5 places left after #1537, not taking into account examples/tests/tests generators:

➜  manticore git:(master) ✗ git grep 'raise Exception' | grep -v examples | grep -v test_ | grep -v make_tests | grep 'raise Exception'
manticore/core/manticore.py:973:                    raise Exception("Deadlock: Waiting for CTRL+C")
manticore/core/plugin.py:129:            raise Exception
manticore/ethereum/cli.py:61:                    raise Exception(
manticore/platforms/decree.py:283:                raise Exception("Set_brk can never work. avoid overflows")
manticore/utils/helpers.py:88:                raise Exception(

And taking everything else into account its 15:

➜  manticore git:(master) ✗ git grep 'raise Exception' | wc -l
      15

ekilmer added a commit that referenced this issue Oct 18, 2019
* master:
  Remove generic exceptions (#1428) (#1537)
  Add missing will_write_memory event in write_bytes (#1535)
  Fix #1533 (#1534)
  Unsigned div constant folding simplification (#1530)
  ADDMOD and MULMOD fixes (#1531)
  perf: avoid multiple calls to read same self.PC (#1527)
  Adds test for memory max_exec_size (#1524)
  Add partial implementation of recvfrom syscall (#1514)
  perf: optimize decode_instruction (#1522)
  Clean-up log (#1520)
  Added storage change detection plugin (#1507)
  Add serialization/deserialization log messages. (#1518)
  Eliminate bogus generate_testcase argument. (#1517)
  Expose hard-coded dynamic load address for ELF sections (#1515)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants