-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: bug toast message for when export default is not present in js object. #36296
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
Changes from 1 commit
ae5801f
9e6364c
4161ef0
219e69f
5c02876
0dc86b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -278,7 +278,11 @@ export function* evalErrorHandler( | |||||||||||||||||||||||||||||
| break; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| case EvalErrorTypes.PARSE_JS_ERROR: { | ||||||||||||||||||||||||||||||
| toast.show(`${error.message} at: ${error.context?.entity.name}`, { | ||||||||||||||||||||||||||||||
| let errorMessage = error.message; | ||||||||||||||||||||||||||||||
| if (!!error.context) { | ||||||||||||||||||||||||||||||
| errorMessage = `${error.message} at: ${error.context?.propertyPath}`; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| toast.show(errorMessage, { | ||||||||||||||||||||||||||||||
|
Comment on lines
+290
to
+296
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Class, let's examine the changes in our error handling. Now, students, I want you to pay close attention to how we've simplified our error message construction. This is a good step towards clarity, but we have a small issue to address.
Let's make a small correction to improve our code: -if (!!error.context) {
+if (error.context) {
errorMessage = `${error.message}`;
}This change will make our code cleaner and easier to read. Remember, class, always strive for clarity and simplicity in your code! 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome
|
||||||||||||||||||||||||||||||
| kind: "error", | ||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||
| AppsmithConsole.error({ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.