Add s3 error output
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm 2020-10-14 16:48:27 +02:00
parent 2194bf199e
commit 1b7c4847dc
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
export * as S3 from "https://deno.land/x/s3@0.2.0/mod.ts"; export * as S3 from "https://deno.land/x/s3@0.2.0/mod.ts";
export { S3Error } from "https://deno.land/x/s3@0.2.0/src/error.ts";
export * as Ini from "https://deno.hibas123.de/raw/ini@0.0.1/mod.ts"; export * as Ini from "https://deno.hibas123.de/raw/ini@0.0.1/mod.ts";

View File

@ -1,4 +1,4 @@
import { ABC, Path, Compress, FS, Colors } from "../deps.ts"; import { ABC, Path, Compress, FS, Colors, S3Error } from "../deps.ts";
import bucket from "../s3.ts"; import bucket from "../s3.ts";
import { isValidPackageName, basicauth, isValidFullVersion } from "../utils.ts"; import { isValidPackageName, basicauth, isValidFullVersion } from "../utils.ts";
@ -145,7 +145,7 @@ async function uploadPackage(ctx: ABC.Context) {
const bucketPath = (bucketBase + relative).replace(/@/g, "§"); const bucketPath = (bucketBase + relative).replace(/@/g, "§");
const body = await Deno.readAll(await Deno.open(file.path)); const body = await Deno.readAll(await Deno.open(file.path));
console.log("Put Object", bucketPath); console.log("Put Object", bucketPath, body.byteLength);
await bucket.putObject(bucketPath, body, {}); await bucket.putObject(bucketPath, body, {});
} }
console.log("Setting new live version"); console.log("Setting new live version");
@ -171,6 +171,7 @@ async function uploadPackage(ctx: ABC.Context) {
Colors.red("Error while processing newly uploaded package") Colors.red("Error while processing newly uploaded package")
); );
console.error(err); console.error(err);
if (err instanceof S3Error) console.log(err.response);
return { return {
success: false, success: false,
message: err.message, message: err.message,