GP-65 - Error Dialog - updated the error dialog to accumulate errors

while it is open instead of repeatedly showing new dialogs
This commit is contained in:
dragonmacher 2020-08-20 17:37:44 -04:00
parent 4506acddf9
commit fc247aa499
44 changed files with 1784 additions and 1662 deletions

View file

@ -89,7 +89,7 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
protected DBHandle dbHandle;
private AddressMap addrMap;
private ErrorHandler errHandler;
private ErrorHandler errHandler = new DbErrorHandler();
private DataTypeConflictHandler currentHandler;
private CategoryDB root;
@ -168,12 +168,7 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
*/
protected DataTypeManagerDB() {
this.lock = new Lock("DataTypeManagerDB");
errHandler = new ErrorHandler() {
@Override
public void dbError(IOException e) {
Msg.showError(this, null, "IO ERROR", e.getMessage(), e);
}
};
try {
dbHandle = new DBHandle();
int id = startTransaction("");
@ -213,13 +208,6 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
") for read-only Datatype Archive: " + packedDBfile.getAbsolutePath());
}
errHandler = new ErrorHandler() {
@Override
public void dbError(IOException e) {
Msg.showError(this, null, "IO ERROR", e.getMessage(), e);
}
};
// Open packed database archive
boolean openSuccess = false;
PackedDatabase pdb = null;
@ -4089,6 +4077,20 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
}
}
}
private class DbErrorHandler implements ErrorHandler {
@Override
public void dbError(IOException e) {
String message = e.getMessage();
if (e instanceof ClosedException) {
message = "Data type archive is closed: " + getName();
}
Msg.showError(this, null, "IO ERROR", message, e);
}
}
}
/**