mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-02 21:57:41 +00:00
feat(developer): ldml import/implied keys : review comment 🙀
- add a TODO comment about using a custom error class
This commit is contained in:
parent
55f5a57425
commit
a40ee01767
1 changed files with 2 additions and 1 deletions
|
|
@ -118,10 +118,11 @@ export default class LDMLKeyboardXMLSourceFileReader {
|
|||
|
||||
private resolveOneImport(obj: any, subtag: string, asImport: LKImport) {
|
||||
if (asImport.base !== constants.cldr_import_base) {
|
||||
// TODO-LDML: use custom error class CompilerImportResolveError
|
||||
throw new Error(`import element with base ${asImport.base} is unsupported, only ${constants.cldr_import_base} is supported.`);
|
||||
}
|
||||
const paths = asImport.path.split('/');
|
||||
if (!paths[0] || !paths[1] || paths.length !== 2) {
|
||||
if (paths[0] == '' || paths[1] == '' || paths.length !== 2) {
|
||||
throw new Error(`import element with invalid path ${asImport.path}: expect the form '${constants.cldr_version_latest}./*.xml'`);
|
||||
}
|
||||
const importData: Uint8Array = this.readImportFile(paths[0], paths[1]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue