Skip to content

Handle Exception #64

@discospiff

Description

@discospiff

If something goes wrong and you catch an exception here, what's the best behavior?
Can you heal the exception?
Should you rethrow the exception?

Returning an empty object and/or null is often not the best idea, as the calling method, and thus the user, won't know something went wrong.

As it exists here, you're taking valuable information about what went wrong (the Exception object), ignoring it, and then acting as if the program operated properly. This will be very confusing to the user.

Recommendations:

  1. Use proper logging, which has the concepts of logging levels.
  2. Give a useful indication to the user, but not too detailed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions