Skip to content

Commit

Permalink
feat: add error option for fallback in conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
polygonplanet committed Jun 8, 2024
1 parent e9edbed commit e79dae6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/encoding-convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,8 @@ function handleFallback(results, bytes, fallbackOption) {
results[results.length] = 0x3B; // ;
}
break;
case 'error':
throw new Error('Character cannot be represented: [' + bytes.join(', ') + ']');
case 'ignore':
break;
}
Expand Down

0 comments on commit e79dae6

Please sign in to comment.