added db init error

This commit is contained in:
Andy Gup 2014-05-22 12:48:24 -06:00
parent 40571787ee
commit 459351349f

View File

@ -26,6 +26,7 @@ define([
VALIDATION_ERROR: "validationError", // Library validation error.
DATABASE_ERROR: "databaseError", // An error thrown by the database.
PARSING_ERROR: 'parsingError', // An error was encountered while parsing a TPK file.
DB_INIT_ERROR: "dbInitError", // An error occurred while initializing the database.
PROGRESS_EVENT: "progress", // Event dispatched while parsing a bundle file.
PROGRESS_START: "start",
PROGRESS_END: "end",
@ -176,7 +177,7 @@ define([
this.store.init(function(result){
if(result == false){
console.error(new Error( "There was an error initializing the database.").stack);
this.emit(this.DATABASE_ERROR,{msg:"Unable to initialize the database.", err: null});
this.emit(this.DATABASE_ERROR,{msg:this.DB_INIT_ERROR, err: null});
}
else{
this.store.usedSpace(function(size,err){