Improve error handling in DishWorker
Throws DishError when cptable.utils.decode fails
This commit is contained in:
parent
87bc4f3c82
commit
5ea1b146da
@ -98,7 +98,7 @@ async function bufferToStr(data) {
|
||||
try {
|
||||
str = cptable.utils.decode(data.encoding, new Uint8Array(data.buffer));
|
||||
} catch (err) {
|
||||
str = err.message;
|
||||
str = new DishError(`Error decoding buffer with encoding ${CHR_ENC_SIMPLE_REVERSE_LOOKUP[data.encoding]}: ${err.message}`).toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user