From 685dd6223d0c84c78e702a9e437417be64d2c170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Mon, 2 Jul 2018 12:55:54 +0200 Subject: [PATCH] added error logging everywhere --- json.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/json.go b/json.go index 4bc010d..724536c 100644 --- a/json.go +++ b/json.go @@ -152,17 +152,20 @@ func UpdateEntityModels(command string) (total, upd, add int, err error) { if driver == "ora" { uStmt, err = metadataDB.Prepare("update entities set entity_model = :1 where entity_type = :2") if err != nil { + logger.Trace(err.Error()) return } } else if driver == "mysql" { uStmt, err = metadataDB.Prepare("update entities set entity_model = ? where entity_type = ?") if err != nil { + logger.Trace(err.Error()) return } } for _, k := range toUpdate { _, err = uStmt.Exec(string(updateQue[k]), k) if err != nil { + logger.Trace(err.Error()) return } upd++ @@ -173,17 +176,20 @@ func UpdateEntityModels(command string) (total, upd, add int, err error) { if driver == "ora" { iStmt, err = metadataDB.Prepare("insert into entities(projekat, metadata, entity_type, entity_model) values(:1, :2, :3, :4)") if err != nil { + logger.Trace(err.Error()) return } } else if driver == "mysql" { iStmt, err = metadataDB.Prepare("insert into entities(projekat, metadata, entity_type, entity_model) values(?, ?, ?, ?)") if err != nil { + logger.Trace(err.Error()) return } } for _, k := range toAdd { _, err = iStmt.Exec(activeProject, string(blankPayload), k, string(updateQue[k])) if err != nil { + logger.Trace(err.Error()) return } metadata[k] = Payload{} -- 1.8.1.2