GitHub user StephanEwen opened a pull request:
https://github.com/apache/flink/pull/3368
[FLINK-5854] [core] Add base Flink Exception classes
This pull request adds two exception base classes: `FlinkException` and
`FlinkRuntimeException`.
They are useful in improving the way certain parts of the code handle
exceptions.
- `FlinkException` is a base class for checked exceptions that indicate
that something related to using Flink went wrong. It is helpful, because
letting a method throw `FlinkException` rather than `Exception` already helps
to not include all of Java's runtime exceptions, which indicate programming
errors, rather than situations that should be recovered.
- `FlinkRuntimeException` as a Flink-specific subclass of
`RuntimeException` comes in handy in places where no exceptions were declared,
for example when reusing an interface that does not declare exceptions.
**Important: This does not mean we should just declare `FlinkException`
everywhere and throw and catch `FlinkException` and `FlinkRuntimeException`
arbitrarily. Exception handling remains a careful and conscious task.**
This also adds the `DynamicCodeLoadingException` subclass of
`FlinkException` as an example.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/StephanEwen/incubator-flink exceptions
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/3368.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3368
----
commit 1bed2d20a5ccfae4ae7bdfadaaf03fcbe1dba449
Author: Stephan Ewen <[email protected]>
Date: 2017-02-17T15:24:35Z
[FLINK-XXXX] [core] Add base Flink Exception classes
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---