Skip to content

Commit

Permalink
Merge pull request #17 from StauroDEV:output-filebase-error-text
Browse files Browse the repository at this point in the history
fix: output filebase error text in verbose mode
  • Loading branch information
talentlessguy authored Dec 8, 2023
2 parents 9e1eb44 + f2a6d15 commit fb2baf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/providers/filebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const uploadOnFilebase: UploadFunction = async ({ first, car, name, token

const res = await uploadCar({ apiUrl: 's3.filebase.com', file, token, bucketName })

if (verbose) logger.request('PUT', res.url, res.status)
if (verbose) logger.request('PUT', res.url, res.status, await res.text())

return { cid: res.headers.get('x-amz-meta-cid')!, status: 'queued' }
}
Expand Down
6 changes: 3 additions & 3 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export const logger = {
success(...args: unknown[]) {
console.log('✔', ...args)
},
request(method: 'GET' | 'POST' | 'PUT', url: string, status: number) {
if (isTTY) console.log('\n', method === 'GET' ? cyan(method) : green(method), url, responseStatus(status))
else console.log('\n', method, url, status)
request(method: 'GET' | 'POST' | 'PUT', url: string, status: number, body?: unknown) {
if (isTTY) console.log('\n', method === 'GET' ? cyan(method) : green(method), url, responseStatus(status), body)
else console.log('\n', method, url, status, body)
},
}

Expand Down

0 comments on commit fb2baf9

Please sign in to comment.