Skip to content

Utilities for exception handling and general case common exception types.

License

Notifications You must be signed in to change notification settings

qudini/qudini-exceptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qudini-exceptions

CircleCI

Utilities for exception handling and general case common exception types.

Provides exceptions such as:

  • ExhaustedConditionException
  • IllegalDataModelException
  • InvalidCodePathException
  • ...and more.

Report errors but continue without throwing an exception. This is designed for events whose breakages should be logged, but should not break execution flow.

Set<Exception> exceptionsToIgnore = Set.of();
List<Reporter> reporters = List.of(logger::error)
var exceptions = ExceptionsService(exceptionsToIgnore, reporters);

// [..]

exceptions.reportQuietly(() -> {
    doSomethingThatMayCrash1();
    doSomethingThatMayCrash2();
    return successfulResult;
});

Report errors and then continue throwing the exception. This is designed for exceptions that we want explicitly to be logged to services like NewRelic.

exceptions.reportAndRethrow(() -> {
    doSomethingThatMayCrash1();
    doSomethingThatMayCrash2();
    return successfulResult;
});

About

Utilities for exception handling and general case common exception types.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •