Skip to content

Commit

Permalink
Merge pull request #5196 from Shopify/shauns/01-15-fix_error_handler_…
Browse files Browse the repository at this point in the history
…for_invalid_toml_files

Fix error handler for invalid TOML files
  • Loading branch information
shauns authored Jan 15, 2025
2 parents 271e28c + 4969c1f commit 3135ec6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-guests-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/app': patch
---

Better error message for certain types of invalid app TOML files
2 changes: 1 addition & 1 deletion packages/app/src/cli/models/app/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function loadConfigurationFileContent(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
// TOML errors have line, pos and col properties
if (err.line && err.pos && err.col) {
if (err.line !== undefined && err.pos !== undefined && err.col !== undefined) {
return abortOrReport(
outputContent`Fix the following error in ${outputToken.path(filepath)}:\n${err.message}`,
{},
Expand Down

0 comments on commit 3135ec6

Please sign in to comment.