api fixes and error log instead of panic

This commit is contained in:
Thomas Rudin 2019-03-18 20:01:57 +01:00
parent 8cc9a67215
commit f1ee971020
2 changed files with 9 additions and 2 deletions

View File

@ -71,7 +71,14 @@ func (a *MapBlockAccessor) FindMapBlocksByMtime(lastmtime int64, limit int, laye
mapblock, err := mapblockparser.Parse(block.Data, block.Mtime, block.Pos)
if err != nil {
return nil, err
fields := logrus.Fields{
"x": block.Pos.X,
"y": block.Pos.Y,
"z": block.Pos.Z,
"err": err,
}
logrus.WithFields(fields).Error("parse error")
continue
}
a.Eventbus.Emit(eventbus.MAPBLOCK_RENDERED, mapblock)

View File

@ -9,7 +9,7 @@ var api = {
},
getConfig: function(){
return m.request("/api/config");
return m.request("api/config");
}