fix(protocol): invokeOidb rejects on packet send failure (success=false)
invokeOidb only threw on success=false when an OIDB errorCode was set (the block added in #69); a send failure with no errorCode silently resolved with an undecoded result. Surface it — throw errorMessage || 'packet send failed', matching runOidb and the oidb-service tests that were already red on dev.
This commit is contained in:
1 file changed
+3
@@ -128,6 +128,9 @@ export async function invokeOidb<TCtx extends OidbSender, TReq, TResp, TParams,
|
||||
subCommand
|
||||
);
|
||||
}
|
||||
// success=false without an OIDB error code = the packet send itself failed;
|
||||
// surface it instead of silently resolving with an undecoded response.
|
||||
throw new Error(result.errorMessage || 'packet send failed');
|
||||
}
|
||||
|
||||
const respBytes = result.responseData ?? new Uint8Array(0);
|
||||
|
||||
Reference in new issue
Block a user