Repository navigation
Word warnings and errors by what failed, not by the library or Java class - #49
Merged
Merged
Conversation
…lass CATALOG_INDEX_UNUSABLE and UNSUPPORTED_COLUMN_TYPE describe the database instead of naming Jackcess; the codes are unchanged. Errors read error: <what>: <reason> instead of starting with a Java class name.
A key lookup through a damaged index failed with a plain IOException, so the conversion ended with error: table X failed: IOException: ... instead of naming the input and suggesting Compact and Repair. KeyLookup now wraps it with SourceException.readFailed, as RowStream does for rows.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warnings
The issue codes are unchanged; only the free-text messages change.
CATALOG_INDEX_UNUSABLE(AccessSource): since Jackcess 5.0.3 this only appears for a damaged index, so it now reads "this database's catalog index is damaged (1 of 8 tables can't be looked up); the catalog was read by scanning it instead". The README row already described a damaged index, so it needed no change.UNSUPPORTED_COLUMN_TYPE(TableReader): "this column type (COMPLEX_TYPE) can't be decoded; its raw bytes are kept".Errors that started with a Java class name
Every error now reads
error: <what>: <reason>:verify --jdbc-url, can't connect (JdbcOptions)error: IOException: can't connect to <url>: <reason><advice>error: <url>: can't connect: <reason><advice>--jdbc-driverjar missing (JdbcOptions)error: NoSuchFileException: <jar>: no such JDBC driver jarerror: <jar>: no such JDBC driver jar--jdbc-driverjar with no matching driver (JdbcOptions)error: IOException: <jar> has no JDBC driver for <url>error: <jar>: no JDBC driver in it accepts <url>verifyoutput missing (Main.requireFile)error: NoSuchFileException: <file>: no such fileerror: <file>: no such fileverify --jdbc-url, reading the database fails (VerifyCommand,MySqlVerifier)error: IOException: reading the database failed: …orerror: IOException: the database could not be read back: …error: <url>: reading the database failed: …verifyof a SQLite output it can't read (SqliteVerifier)error: IOException: the output could not be read back: …error: <output>: the output could not be read back: …SqliteWriter): an SQL error,PRAGMA integrity_check, or the foreign-key checkerror: IOException: writing the SQLite output failed: …(and the sameIOException:prefix on the other two)error: <output>: SQLite could not write it: …,error: <output>: PRAGMA integrity_check failed: …, …--binary filesname escaping its directory (BinaryFiles, can't happen)error: IOException: the file name …error: <output>: the file name …How it works:
Main.messageprints a plainIOException's message as is. Our own messages now always start by naming what failed.<file>: <reason>. One without a reason gets the reason in words for the common cases: no such file, no permission, not a folder, already exists, folder not empty.OutputException.ofputs a plainIOExceptionraised while an output is built under that output's name.MySqlVerifier.verifynow lets theSQLExceptionthrough, soVerifyCommandnames the URL.A damaged index found while checking relationships
Damaging the index of a relationship's parent table made
convertend witherror: table <name> failed: IOException: Unexpected order in index entries …. The index fails while the data is checked before writing: the relationship check looks parent keys up through it. That lookup doesn't go throughRowStream, so the error wasn't aSourceException, and under--on-table-error failTableFailurethrew a plainIOException.KeyLookup(and creating it inAccessSource.keyLookup) now wraps anIOExceptionwithSourceException.readFailed, asRowStreamdoes. The error therefore reads like the others:error: <input>: reading table <name> failed (IOException: Unexpected order in index entries …); the file may be damaged: try Compact and Repair in Access. It is reported asTABLE_READ_FAILEDwith the same text. Unchecked exceptions pass through unchanged, soParentKeysstill falls back to scanning when Jackcess can't seek an index's collation.A table that fails to be written under
failis still named after the output:error: <output>: table <name> failed: ….MainTest: a missing input, an unreachable--jdbc-url, a missing--jdbc-driver, andMain.messageitself.AtomicOutputTestcovers a plain error being put under the output's name.CatalogIndexTestnow pins the whole new warning text.VerifyJdbcITchecks the new connection-error prefix against MySQL.unsupportedFieldsV2007golden file is updated.ConvertCommandTest.aDamagedIndexReadsLikeAnyDamagedTabledamages theCustomersprimary-key index of the schema-fidelity fixture with a newDamagedCopy.withIndexDamagedhelper. Without the fix it fails with the olderror: table Customers failed: IOException: Unexpected order in index entries ….SqliteTableErrorTest.aWriteFailureUnderFailNamesTheOutputcovers a write failure underfail../mvnw -B -ntp verifyand./mvnw -B -ntp verify -Pintegrationboth pass.