Skip to content

Commit

Permalink
clearer error message (#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
b1conrad authored Feb 13, 2024
1 parent 9ad5e53 commit f731d2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/krl-compiler/src/c/Ruleset.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module.exports = function (ast, comp, e) {
throw comp.error(share.loc, 'Trying to share: ' + share.value + ' but it\'s not defined in global')
}
if (annotation && annotation.type === 'Action') {
throw comp.error(annotation.loc, 'Actions cannot be used queries: ' + share.value)
throw comp.error(annotation.loc, 'Actions must not be shared: ' + share.value)
} else {
queries[share.value] = e('asyncfn', ['query', 'qid'], [
e(';', e('call', e('id', '$ctx.setQuery'), [e('call', e('id', 'Object.assign'), [
Expand Down
2 changes: 1 addition & 1 deletion packages/krl-compiler/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ test('compiler errors', function (t) {

tstFail(
'ruleset a{meta{shares hello}global {hello = defaction(){noop()}}}',
'Error: Actions cannot be used queries: hello'
'Error: Actions must not be shared: hello'
)

tstWarn(
Expand Down

0 comments on commit f731d2f

Please sign in to comment.