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

Feat/js known errors #1514

Merged
merged 8 commits into from
Jun 10, 2022
Merged

Feat/js known errors #1514

merged 8 commits into from
Jun 10, 2022

Conversation

Blu-J
Copy link
Contributor

@Blu-J Blu-J commented Jun 8, 2022

fixes: #1512

About

We where hoping that the return type could also be or'ed with a known error shape as a return. Indicating to rust that we know that there is an expected error. Other errors are things like the infamous using method of undefined. Or something else we didn't catch or mind that we will say uncaught.

Proof of working

Now the error looks like
image

When the code looked like

type KnownError = { error: string };

export async function setConfig(
  effects: Effects,
  input: Config,
): Promise<SetResult | KnownError> {
  return { error: "This is a test" };
}

@Blu-J Blu-J requested a review from dr-bonez June 8, 2022 20:36
@Blu-J
Copy link
Contributor Author

Blu-J commented Jun 9, 2022

Updated to use the agreed upon types in our research internal

@Blu-J
Copy link
Contributor Author

Blu-J commented Jun 9, 2022

image
image

@Blu-J Blu-J force-pushed the feat/js-known-errors branch from d4e99ca to 406609b Compare June 9, 2022 21:25
@Blu-J Blu-J force-pushed the feat/js-known-errors branch from 406609b to b6e20b3 Compare June 9, 2022 22:05
@Blu-J Blu-J merged commit 5a88f41 into master Jun 10, 2022
@Blu-J Blu-J deleted the feat/js-known-errors branch July 11, 2022 20:58
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.

[bug]: Embassy-Os Js Procudure Known Error
3 participants