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

Add error messages to translationFn call #49

Open
nf-s opened this issue Aug 24, 2021 · 0 comments
Open

Add error messages to translationFn call #49

nf-s opened this issue Aug 24, 2021 · 0 comments

Comments

@nf-s
Copy link
Contributor

nf-s commented Aug 24, 2021

We should handle errors thrown here

if (Object.prototype.hasOwnProperty.call(source, propV7)) {
const value =
!is.string(prop) && typeof prop.translationFn === "function"
? prop.translationFn(source[propV7])
: source[propV7];
if (typeof value !== "undefined") destination[propV8] = value;
}

and wrap them in a nice error message - eg "Failed to translate prop someProp: errorMessage"

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

1 participant