Skip to content

Commit 05207fc

Browse files
committed
Externalize internal error messages
1 parent c5b45b0 commit 05207fc

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

src/main/java/org/mybatis/dynamic/sql/util/GeneralInsertMappingVisitor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
public abstract class GeneralInsertMappingVisitor<R> implements ColumnMappingVisitor<R> {
1919
@Override
2020
public final R visit(SelectMapping mapping) {
21-
throw new UnsupportedOperationException();
21+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "1")); //$NON-NLS-1$ //$NON-NLS-2$
2222
}
2323

2424
@Override
2525
public final R visit(PropertyMapping mapping) {
26-
throw new UnsupportedOperationException();
26+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "2")); //$NON-NLS-1$ //$NON-NLS-2$
2727
}
2828

2929
@Override
3030
public final R visit(PropertyWhenPresentMapping mapping) {
31-
throw new UnsupportedOperationException();
31+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "3")); //$NON-NLS-1$ //$NON-NLS-2$
3232
}
3333

3434
@Override
3535
public final R visit(ColumnToColumnMapping columnMapping) {
36-
throw new UnsupportedOperationException();
36+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "4")); //$NON-NLS-1$ //$NON-NLS-2$
3737
}
3838
}

src/main/java/org/mybatis/dynamic/sql/util/InsertMappingVisitor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
public abstract class InsertMappingVisitor<R> implements ColumnMappingVisitor<R> {
1919
@Override
2020
public final <T> R visit(ValueMapping<T> mapping) {
21-
throw new UnsupportedOperationException();
21+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "5")); //$NON-NLS-1$ //$NON-NLS-2$
2222
}
2323

2424
@Override
2525
public final <T> R visit(ValueOrNullMapping<T> mapping) {
26-
throw new UnsupportedOperationException();
26+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "6")); //$NON-NLS-1$ //$NON-NLS-2$
2727
}
2828

2929
@Override
3030
public final <T> R visit(ValueWhenPresentMapping<T> mapping) {
31-
throw new UnsupportedOperationException();
31+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "7")); //$NON-NLS-1$ //$NON-NLS-2$
3232
}
3333

3434
@Override
3535
public final R visit(SelectMapping mapping) {
36-
throw new UnsupportedOperationException();
36+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "8")); //$NON-NLS-1$ //$NON-NLS-2$
3737
}
3838

3939
@Override
4040
public final R visit(ColumnToColumnMapping columnMapping) {
41-
throw new UnsupportedOperationException();
41+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "9")); //$NON-NLS-1$ //$NON-NLS-2$
4242
}
4343
}

src/main/java/org/mybatis/dynamic/sql/util/MultiRowInsertMappingVisitor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
public abstract class MultiRowInsertMappingVisitor<R> extends InsertMappingVisitor<R> {
1919
@Override
2020
public final R visit(PropertyWhenPresentMapping mapping) {
21-
throw new UnsupportedOperationException();
21+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "12")); //$NON-NLS-1$ //$NON-NLS-2$
2222
}
2323
}

src/main/java/org/mybatis/dynamic/sql/util/UpdateMappingVisitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
public abstract class UpdateMappingVisitor<R> implements ColumnMappingVisitor<R> {
1919
@Override
2020
public final R visit(PropertyMapping mapping) {
21-
throw new UnsupportedOperationException();
21+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "10")); //$NON-NLS-1$ //$NON-NLS-2$
2222
}
2323

2424
@Override
2525
public final R visit(PropertyWhenPresentMapping mapping) {
26-
throw new UnsupportedOperationException();
26+
throw new UnsupportedOperationException(Messages.getString("ERROR.31", "11")); //$NON-NLS-1$ //$NON-NLS-2$
2727
}
2828
}

src/main/resources/org/mybatis/dynamic/sql/util/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ ERROR.27=You must specify a "from" clause before any other clauses in a select s
4646
ERROR.28=You must specify a select statement in a sub query
4747
ERROR.29=Insert Select Statements Must Contain an "into" phrase
4848
ERROR.30=The parameters for insertMultipleWithGeneratedKeys must contain exactly one parameter of type String
49+
ERROR.31=Internal Error {0}

0 commit comments

Comments
 (0)