Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing Exception instead of extending Error #39

Closed
bytes7bytes7 opened this issue Feb 21, 2023 · 4 comments
Closed

Implementing Exception instead of extending Error #39

bytes7bytes7 opened this issue Feb 21, 2023 · 4 comments

Comments

@bytes7bytes7
Copy link

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';
}
@jonasroussel
Copy link
Owner

You are right.
I will see how it will impact the existing code for users of the package. But I'll probably do an update soon.

@jonasroussel
Copy link
Owner

Sorry for the lengthy delay in making these changes, I got a lot of works in my job recently (got promoted CTO).

Latest version (v2.8.1):
pub: https://pub.dev/packages/dart_jsonwebtoken/versions/2.8.1
github: https://github.com/jonasroussel/dart_jsonwebtoken/tree/v2.8.1

@ahmednfwela
Copy link

this should've been a major version pump, not a minor one.
It's breaking dependent packages @jonasroussel

meili-bors bot added a commit to meilisearch/meilisearch-dart that referenced this issue May 30, 2023
313: fix error due to faulty dart_jsonwebtoken breaking change r=brunoocasali a=ahmednfwela

# Pull Request

## What does this PR do?
- rename `JWTError` to `JWTException` due to change in jonasroussel/dart_jsonwebtoken#39 which was marked as a minor change, but it should've been a major one.
- add `example/pubspec.lock` to `.gitignore`


## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Ahmed Fwela <ahmednfwela@bdaya-dev.com>
@jonasroussel
Copy link
Owner

jonasroussel commented May 30, 2023

I'm really sorry about these changes and the problem they caused to your CI.

I was not aware of the fact that pub can update the minor version automatically. I was convinced that pub could only change the "fix" version (2.8.x).

Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants