Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/cli-kit/src/public/node/toml/toml-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ export class TomlFile {
private decode(raw: string): JsonMapType {
try {
return decodeToml(raw)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
if (err.line !== undefined && err.col !== undefined) {
const description = String(err.message).split('\n')[0] ?? 'Invalid TOML'
throw new TomlFileError(this.path, `${description} at row ${err.line}, col ${err.col}`)
} catch (err) {
const tomlError = err as {line?: number; col?: number; message?: string}
if (tomlError.line !== undefined && tomlError.col !== undefined) {
const description = String(tomlError.message).split('\n')[0] ?? 'Invalid TOML'
throw new TomlFileError(this.path, `${description} at row ${tomlError.line}, col ${tomlError.col}`)
}
throw err
}
Expand Down
Loading