Skip to content

PrintH2DatabaseSchema and ExecuteH2DatabaseStatement shouldn't print stack trace #535

@DavidWhitlock

Description

@DavidWhitlock

When the database file doesn't exist (or some other exception occurs while running), the PrintH2DatabaseSchema and ExecuteH2DatabaseStatement main methods should not print stack traces. It's not very useful.

Executing SQL: SELECT * FROM customers

Exception in thread "main" org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "CUSTOMERS" not f\
ound (this database is empty); SQL statement:
SELECT * FROM customers [42104-240]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:514)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
        at org.h2.message.DbException.get(DbException.java:223)
        at org.h2.message.DbException.get(DbException.java:199)
        at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8036)
        at org.h2.command.Parser.getTableOrViewNotFoundDbException(Parser.java:8020)
        at org.h2.command.Parser.readTableOrView(Parser.java:7999)
        at org.h2.command.Parser.readTablePrimary(Parser.java:1772)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions