Skip to content

Commit 9557b8f

Browse files
committed
fix(pngquant): handle upstream errors
err.code has been renamed to err.exitCode in execa Closes #182
1 parent 7413b22 commit 9557b8f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pngquant.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export const pngquant = async (pngFilePaths: string[], options: IOptions): Promi
1515
...pngFilePaths
1616
]);
1717
} catch (err) {
18-
if (err.code !== 99 && err.code !== 98) {
19-
throw new Error(err.message);
18+
if (err.exitCode !== 99 && err.exitCode !== 98) {
19+
throw err;
2020
}
2121
}
2222
};

0 commit comments

Comments
 (0)