Skip to content

Add more descriptive messages to thrown exceptions #71

@StrongestNumber9

Description

@StrongestNumber9

Description

All of the thrown exception messages should be more descriptive. Below are some examples:

throw new IllegalStateException("fragmentState != FragmentState.EMPTY");

throw new IllegalStateException("fragmentState != FragmentState.WRITTEN");

throw new IllegalStateException("fragmentState != FragmentState.WRITTEN");

throw new IllegalStateException("fragmentState != FragmentState.WRITTEN");

For example toBytes() could be refactored:
fragmentState != FragmentState.WRITTEN
->
Can't convert Fragment to bytes: Unexpected FragmentState, expected to be "{expectedstate}", was "{currentstate}"

Use case or motivation behind the feature request

The messages are currently not very helpful as it is hard to distinguish which operation caused the exception and why, especially without stacktraces.

Related issues

teragrep/pth_06#330

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions