Skip to content

Commit

Permalink
fix: serialize error
Browse files Browse the repository at this point in the history
otherwise they are printed as empty
  • Loading branch information
Kikobeats committed Dec 9, 2022
1 parent 28dfeb8 commit 029b3b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"dependencies": {
"debug-logfmt": "~1.0.4",
"node-vibrant": "~3.2.1-alpha.1",
"serialize-error": "~8.1.0",
"sharp": "0.31.1"
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict'

const { serializeError } = require('serialize-error')
const debug = require('debug-logfmt')('splashy')
const createVibrant = require('./vibrant')

Expand All @@ -24,8 +25,8 @@ module.exports = async input => {
try {
const vibrant = createVibrant(input)
swatch = await vibrant.getPalette()
} catch (err) {
debug.error(err)
} catch (error) {
debug.error(serializeError(error))
swatch = {}
}

Expand Down

0 comments on commit 029b3b3

Please sign in to comment.