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

Error handling #3

Open
RealyUniqueName opened this issue Aug 25, 2017 · 2 comments
Open

Error handling #3

RealyUniqueName opened this issue Aug 25, 2017 · 2 comments

Comments

@RealyUniqueName
Copy link

Think about exception proagation scenarios.

@ousado
Copy link

ousado commented Sep 18, 2017

Also think about error handling without exceptions. On some targets, especially cpp, exceptions are prohibitively expensive.

@nadako
Copy link
Owner

nadako commented Sep 18, 2017

Error handling is a tricky subject indeed. Most often (e.g. js,c#,kotlin) it's implemented in coroutines by using try/catch syntax, which is a "natural" way to handle errors in the imperative code. But, even performance aside, it seems to be compromising type safety for syntax consistency in some cases. For example, if we have some API that returns Future<Either<MyResult,MyError>> (I think tink libraries do that), we know the exact type of an error we want to handle (MyError), while try/catch is a generic way to catch any error, which might be less clear and more error-prone. I'm not sure if this is a valid concern or what would be an alternative though, I guess we'll have to make some compromises here...

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