mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
src: rework (mostly internal) functions to use Maybes
Rework all affected functions to use Maybes, thus improving error handling substantially in internal functions, API functions as well as utilities. Co-authored-by: Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/21935 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
1 parent
67403b3a84
commit
a55c57b8c4
10 files changed
+149
-117
No files matched your search
@@ -121,7 +121,7 @@ ssize_t DecodeBytes(Isolate* isolate,
|
||||
enum encoding encoding) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
return StringBytes::Size(isolate, val, encoding);
|
||||
return StringBytes::Size(isolate, val, encoding).FromMaybe(-1);
|
||||
}
|
||||
|
||||
// Returns number of bytes written.
|
||||
|
||||
Reference in new issue
Block a user