Merge pull request #227 from andygup/fix_error_msgs

fixed console.log messages
This commit is contained in:
Andy 2014-08-20 12:27:58 -06:00
commit bc5ca7c88a

View File

@ -190,7 +190,7 @@ define([
_validate: function(){
//Verify if basic functionality is supported by the browser
if(!window.File && !window.FileReader && !window.Blob && !window.btoa && !window.DataView){
console.error(new Error( "This library is not supported on your browser!").stack);
console.log("TPKLayer library is not supported by this browser");
this.emit(this.VALIDATION_EVENT,{msg:this.NO_SUPPORT_ERROR, err : null});
}
else{
@ -202,14 +202,14 @@ define([
{
this.store.init(function(result){
if(result == false){
console.error(new Error( "There was an error initializing the database.").stack);
console.log("There was an error initializing the TPKLayer database");
this.emit(this.DATABASE_ERROR_EVENT,{msg:this.DB_INIT_ERROR, err: null});
}
else{
this.store.usedSpace(function(size,err){
var mb = this._bytes2MBs(size.sizeBytes);
if(mb > this.MAX_DB_SIZE){
console.error(new Error( "Database is full!").stack);
console.log("Database is full!");
this.emit(this.DATABASE_ERROR_EVENT,{msg:this.DB_FULL_ERROR,err : err});
}
this.emit(this.VALIDATION_EVENT,{msg:this.DB_VALIDATED,err : null})
@ -220,7 +220,7 @@ define([
}
else
{
console.error(new Error( "IndexedDB is not supported on your browser.").stack);
console.log("IndexedDB is not supported on your browser.");
this.emit(this.VALIDATION_EVENT,{msg:this.NO_SUPPORT_ERROR, err : null});
}
},
@ -456,7 +456,7 @@ define([
that._buffer2Base64(bufferI,pointer,function(result){
if (that._isDBWriteable)that._storeTile(url, result, db,function(success,err){
if(err){
console.error(new Error( "Error writing to database." + err).stack);
console.log("TPKLayer - Error writing to database." + err.message);
that.emit(that.DATABASE_ERROR_EVENT,{msg:"Error writing to database. ", err : err});
}
});