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

Make SwiftYNABError public & throw .apiError #11

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

daniel-amoafo
Copy link

@daniel-amoafo daniel-amoafo commented Feb 25, 2024

Hi @andrebocchini ,

  • I was trying to inspect the SwiftYNABError in my calling code but wasn't able to because it wasn't publicly available. Updated it's accessor to public.
  • It seems SwiftYNABError.apiError was never thrown by Client. The ErrorDetails and other infrastructure (unit tests and json files) was in place except the actual impl in the Client.swift 😊. If it's unable to create the ErrorDetails, will fallback to .httpError.
  • Added a unit tests when an apiError is expected.

…or type.

- Added fix to show API errors when Client request is made. If ErrorDetails cannot be decoded from payload, will fall back to .httpError code.
Copy link
Owner

@andrebocchini andrebocchini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@andrebocchini andrebocchini merged commit cfb865d into andrebocchini:master Mar 5, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants