Skip to content

Commit 8734515

Browse files
authored
Merge pull request #145 from leapfrogtechnology/improve-logging
Improve verbose logging
2 parents 09955cd + 606e247 commit 8734515

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@leapfrogtechnology/sync-db",
33
"description": "Command line utility to synchronize and version control relational database objects across databases",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"license": "MIT",
66
"main": "lib/index.js",
77
"types": "lib/index.d.ts",

src/commands/synchronize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Synchronize extends Command {
113113

114114
for (const attempt of failedAttempts) {
115115
await printLine(bold(` ▸ ${attempt.connectionId}\n`));
116-
await printError(attempt.error.result.error);
116+
await printError(attempt.error);
117117

118118
// Send verbose error with stack trace to debug logs.
119119
log(attempt.error);

src/service/execution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function executeOperation<T extends OperationContext>(
7878
if (result.error) {
7979
logDb('Result:\n%O', result);
8080

81-
throw { result };
81+
throw result;
8282
}
8383

8484
return result;

src/util/promise.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ export async function runSequentially<T>(promisers: Promiser<T>[]): Promise<T[]>
2525

2626
result.push(value);
2727
} catch (err) {
28-
if (!err.result) {
28+
const errors = err as any;
29+
30+
if (errors.originalError) {
31+
result.push(errors.originalError);
32+
} else if (errors.error) {
33+
result.push(errors.error);
34+
} else {
2935
throw err;
3036
}
31-
32-
result.push(err.result);
3337
}
3438
}
3539

0 commit comments

Comments
 (0)