Is it intentional that the implementations of the ActorCallError, QueryCallRejectedError, and UpdateCallRejectedError classes do not use Object.setPrototypeOf?
The issue is that it currently prevents a type-safe check for an error thrown using this code:
try {
myActor.notFoundQueryMethod();
} catch(e) {
if (e instanceof QueryCallRejectedError) {
// profit!
}
}
The only type-safe check that works now is e instanceof AgentError, which is useless because AgentError has no properties to check.
Hey!
Is it intentional that the implementations of the
ActorCallError
,QueryCallRejectedError
, andUpdateCallRejectedError
classes do not useObject.setPrototypeOf
?The issue is that it currently prevents a type-safe check for an error thrown using this code:
The only type-safe check that works now is
e instanceof AgentError
, which is useless because AgentError has no properties to check.