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

[improve] Provide meaningful debug information for identifier update error #7193

Closed
lifeart opened this issue May 14, 2020 · 2 comments · Fixed by #7337
Closed

[improve] Provide meaningful debug information for identifier update error #7193

lifeart opened this issue May 14, 2020 · 2 comments · Fixed by #7337

Comments

@lifeart
Copy link

lifeart commented May 14, 2020

I see Failed to update the 'id' for the RecordIdentifier '[object Object]' to '27830', because that id is already in use by '[object Object]'.

[object Object] - is not meaningful debug message, and it's tricky to track down issue (modelType? payload?)

image

@snewcomer
Copy link
Contributor

Perhaps we can replace [object Object] with identifier.type || identifier instead. Or stringify the identifier object but that not print out pretty.

Here is another solution for that error.

const identifierOutput = typeof identifier === 'object' ? `id: ${identifier.id}, type: ${identifier.type}` : identifier;

throw new Error(`Failed to update the 'id' for the RecordIdentifier '${identifierOutput} to '${resourceData.id}', because that id is already in use by '${matchedIdentifierOutput'`)

@runspired
Copy link
Contributor

I'm guessing this is a production build? In dev we implement toString for nice ergonomics.

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 a pull request may close this issue.

3 participants