Skip to content

Commit

Permalink
fix: 🐞 don't silently fail when error is an object
Browse files Browse the repository at this point in the history
Following this angular/angular-cli#19951, the logger doesn't log when message is other type than string.
  • Loading branch information
edbzn committed Feb 4, 2021
1 parent 1c900a3 commit 0e8199d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions packages/semver/src/builders/version/builder.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import {
BuilderContext,
BuilderOutput,
createBuilder,
} from '@angular-devkit/architect';
import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect';
import { concat, forkJoin, Observable, of } from 'rxjs';
import { catchError, mapTo, shareReplay, switchMap } from 'rxjs/operators';

import { VersionBuilderSchema } from './schema';
import { tryPushToGitRemote } from './utils/git';
import { tryBump } from './utils/try-bump';
import { getProjectRoot } from './utils/workspace';
import {
CommonVersionOptions,
versionProject,
versionWorkspace,
} from './version';
import { CommonVersionOptions, versionProject, versionWorkspace } from './version';

export function runBuilder(
{
Expand Down Expand Up @@ -79,7 +71,7 @@ export function runBuilder(
return action$.pipe(
mapTo({ success: true }),
catchError((error) => {
context.logger.error(error);
context.logger.error(error.stack ?? error.toString());
context.reportStatus('Error');
return of({ success: false });
})
Expand Down

0 comments on commit 0e8199d

Please sign in to comment.