Skip to content

Implementing Exception instead of extending Error #39

@bytes7bytes7

Description

@bytes7bytes7

You have the JWTError class that extends Error. But, I think, that in this situation, JWTError should implements Exception.
A good explanation you can find here

And also it would be better to rename JWTError to JWTException (and all inheritors too: JWTInvalidError, JWTExpiredError, etc.)

class JWTException implements Exception {
  JWTException(this.message);

  final String message;

  @override
  String toString() => 'JWTException: $message';
}

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