Skip to content

Commit

Permalink
fix: make error handing compatible to latest tsc version
Browse files Browse the repository at this point in the history
  • Loading branch information
Momo Kornher committed Sep 12, 2021
1 parent c709100 commit b5e36e2
Show file tree
Hide file tree
Showing 3 changed files with 1,095 additions and 1,096 deletions.
4 changes: 2 additions & 2 deletions lib/bundlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
FileSystem,
ILocalBundling,
} from "@aws-cdk/core";
import { buildSync, BuildOptions as EsbuildOptions } from "esbuild";
import { buildSync, BuildOptions as EsbuildOptions, BuildFailure } from "esbuild";
import { join, normalize, resolve, posix, PlatformPath } from "path";
import { printBuildMessages } from "./formatMessages";

Expand Down Expand Up @@ -107,7 +107,7 @@ export class LocalBundler implements ILocalBundling {

return true;
} catch (error) {
printBuildMessages(error, { prefix: "Build " });
printBuildMessages(error as BuildFailure, { prefix: "Build " });

return Boolean(this.props.priority === BundlerPriority.LocalOnly);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/inline-code.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InlineCode } from "@aws-cdk/aws-lambda";
import { transformSync, TransformOptions, Loader } from "esbuild";
import { transformSync, TransformOptions, Loader, BuildFailure } from "esbuild";
import { printBuildMessages } from "./formatMessages";

abstract class BaseInlineCode extends InlineCode {
Expand All @@ -17,7 +17,7 @@ abstract class BaseInlineCode extends InlineCode {

super(transformedCode.code);
} catch (error) {
printBuildMessages(error, { prefix: "Transform " });
printBuildMessages(error as BuildFailure, { prefix: "Transform " });

throw new Error("Failed to transform InlineCode");
}
Expand Down
Loading

0 comments on commit b5e36e2

Please sign in to comment.