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

Considering wrapping data in results to handler errors more gracefully #239

Open
Lilja opened this issue May 20, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Lilja
Copy link

Lilja commented May 20, 2023

Enhancement description

I would much rather deal with the result pattern of data, instead of having to try-catch every single function to handle errors.

// Now
const getTasks = (): Promise<Task[]> => {}
// Desired
const getTasks = (): Promise<Result<Task[], Error>> => {}

The problem it solves

At this very moment, I'm using this SDK to query tasks from my todoist account. It would seem like the Todoist API is returning 502 errors, which are just being thrown as exceptions.

bild
@Lilja Lilja added the enhancement New feature or request label May 20, 2023
@henningmu
Copy link
Contributor

Thank you for the proposal, @Lilja. We currently don't have plans to add support for this, but will consider it in a future version 🙌

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

No branches or pull requests

2 participants