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:
DrSmoothl committed 2026-06-04 23:36:22 +08:00
1 parent 34ea2ce438
commit 9374b8ac64
1 file changed
+3
+3
View File
@@ -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);