Skip to content

Commit

Permalink
more user-friendly jsg exception message (#2532)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea authored Aug 19, 2024
1 parent 2561f1f commit 8b8f52d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/workerd/jsg/struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ class StructWrapper<Self, T, TypeTuple<FieldWrappers...>, kj::_::Indexes<indices
kj::isSameType<typename FieldWrappers::Type, Unimplemented>()) && ...)) {
return T{};
}
jsg::throwTypeError(isolate, "Cannot initialize a dictionary with required members from an "
"undefined or null value.");
jsg::throwTypeError(isolate, kj::str("Cannot initialize ", typeid(T).name(),
" with required members from an "
"undefined or null value."));
}

if (!handle->IsObject()) return kj::none;
Expand Down

0 comments on commit 8b8f52d

Please sign in to comment.