Commit 685dd6223d0c84c78e702a9e437417be64d2c170
1 parent
3f8e3c4374
Exists in
master
and in
1 other branch
added error logging everywhere
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
json.go
... | ... | @@ -152,17 +152,20 @@ func UpdateEntityModels(command string) (total, upd, add int, err error) { |
152 | 152 | if driver == "ora" { |
153 | 153 | uStmt, err = metadataDB.Prepare("update entities set entity_model = :1 where entity_type = :2") |
154 | 154 | if err != nil { |
155 | + logger.Trace(err.Error()) | |
155 | 156 | return |
156 | 157 | } |
157 | 158 | } else if driver == "mysql" { |
158 | 159 | uStmt, err = metadataDB.Prepare("update entities set entity_model = ? where entity_type = ?") |
159 | 160 | if err != nil { |
161 | + logger.Trace(err.Error()) | |
160 | 162 | return |
161 | 163 | } |
162 | 164 | } |
163 | 165 | for _, k := range toUpdate { |
164 | 166 | _, err = uStmt.Exec(string(updateQue[k]), k) |
165 | 167 | if err != nil { |
168 | + logger.Trace(err.Error()) | |
166 | 169 | return |
167 | 170 | } |
168 | 171 | upd++ |
... | ... | @@ -173,17 +176,20 @@ func UpdateEntityModels(command string) (total, upd, add int, err error) { |
173 | 176 | if driver == "ora" { |
174 | 177 | iStmt, err = metadataDB.Prepare("insert into entities(projekat, metadata, entity_type, entity_model) values(:1, :2, :3, :4)") |
175 | 178 | if err != nil { |
179 | + logger.Trace(err.Error()) | |
176 | 180 | return |
177 | 181 | } |
178 | 182 | } else if driver == "mysql" { |
179 | 183 | iStmt, err = metadataDB.Prepare("insert into entities(projekat, metadata, entity_type, entity_model) values(?, ?, ?, ?)") |
180 | 184 | if err != nil { |
185 | + logger.Trace(err.Error()) | |
181 | 186 | return |
182 | 187 | } |
183 | 188 | } |
184 | 189 | for _, k := range toAdd { |
185 | 190 | _, err = iStmt.Exec(activeProject, string(blankPayload), k, string(updateQue[k])) |
186 | 191 | if err != nil { |
192 | + logger.Trace(err.Error()) | |
187 | 193 | return |
188 | 194 | } |
189 | 195 | metadata[k] = Payload{} | ... | ... |