mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Show proper message on empty Excel import, rather than a code error
Summary:
- Previously showed "UnboundLocalError". Now will show:
Import failed: Failed to parse Excel file.
Error: No tables found (1 empty tables skipped)
- Also fix logging for import code
Test Plan: Added a test case
Reviewers: georgegevoian
Reviewed By: georgegevoian
Differential Revision: https://phab.getgrist.com/D3396
This commit is contained in:
@@ -141,7 +141,7 @@ export class DocPluginManager {
|
||||
'.csv' : 'CSV',
|
||||
};
|
||||
const fileType = extToType[path.extname(fileName)] || path.extname(fileName);
|
||||
throw new Error(`Failed to parse ${fileType} file. Error: ${messages.join("; ")}`);
|
||||
throw new Error(`Failed to parse ${fileType} file.\nError: ${messages.join("; ")}`);
|
||||
}
|
||||
throw new Error(`File format is not supported.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user