Skip to content

Commit

Permalink
fix: show ux file path for invalid <data> in lite card
Browse files Browse the repository at this point in the history
Signed-off-by: Yingchun <[email protected]>
  • Loading branch information
ZhangYingchun-OPPO committed Oct 22, 2024
1 parent d88a7b5 commit df91760
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/hap-dsl-xvm/src/loaders/action-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function actionLoader(source) {
const obj = JSON.parse(source)
jsonObj = obj.actions || {}
} catch (e) {
throw new Error(`Invalid <data> in action loader:: ${e}`)
throw new Error(`Invalid <data> in ${this.resourcePath}:: ${e}`)
}
return `module.exports = ${JSON.stringify(jsonObj)}`
}
2 changes: 1 addition & 1 deletion packages/hap-dsl-xvm/src/loaders/data-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function dataLoader(source) {
const obj = JSON.parse(source)
jsonObj = obj.uiData || obj.data || {}
} catch (e) {
throw new Error(`Invalid <data> in data loader:: ${e}`)
throw new Error(`Invalid <data> in ${this.resourcePath}:: ${e}`)
}
return `module.exports = ${JSON.stringify(jsonObj)}`
}
2 changes: 1 addition & 1 deletion packages/hap-dsl-xvm/src/loaders/props-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function propsLoader(source) {
const obj = JSON.parse(source)
jsonObj = obj.props || {}
} catch (e) {
throw new Error(`Invalid <data> in props loader:: ${e}`)
throw new Error(`Invalid <data> in ${this.resourcePath}:: ${e}`)
}
return `module.exports = ${JSON.stringify(jsonObj)}`
}

0 comments on commit df91760

Please sign in to comment.