Skip to content

Commit

Permalink
Unify exception types for invalid operators and combinators
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed May 9, 2016
1 parent 623517f commit c4b9d68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions models/Query/Builder.cfc
Expand Up @@ -137,7 +137,7 @@ component displayname='Builder' {
}
else if (isInvalidCombinator(arguments.combinator)) {
throw(
type = 'InvalidArgumentException',
type = 'InvalidSQLType',
message = 'Illegal combinator'
);
}
Expand All @@ -148,7 +148,7 @@ component displayname='Builder' {
}
else if (isInvalidOperator(arguments.operator)) {
throw(
type = 'InvalidArgumentException',
type = 'InvalidSQLType',
message = 'Illegal operator'
);
}
Expand Down
4 changes: 2 additions & 2 deletions models/Query/JoinClause.cfc
Expand Up @@ -26,7 +26,7 @@ component displayname='JoinClause' {
required string table
) {
if (! arrayContainsNoCase(types, arguments.type)) {
throw('[#type#] is not a valid sql join type');
throw(type = 'InvalidSQLType', message = '[#type#] is not a valid sql join type');
}

variables.type = arguments.type;
Expand All @@ -46,7 +46,7 @@ component displayname='JoinClause' {
}

if (! arrayContainsNoCase(operators, arguments.operator)) {
throw('[#operator#] is not a valid sql operator type');
throw(type = 'InvalidSQLType', message = '[#operator#] is not a valid sql operator type');
}

if (arguments.where) {
Expand Down

0 comments on commit c4b9d68

Please sign in to comment.