This commit is contained in:
DrSmoothl committed 2026-10-12 15:43:34 +08:00
1 parent effeb66554
commit 7c0519f75f
977 files changed
+198426 -158324

No files matched your search

@@ -1,16 +1,15 @@
import type { SendPacketResult } from '@snowluma/common/packet-sender';
export function requirePacketResponse(
result: SendPacketResult,
command: string,
): Uint8Array {
if (!result.success) {
throw new Error(
`${command} transport failed: ${result.errorMessage || 'unknown transport error'}`,
);
}
if (!result.gotResponse || !result.responseData || result.responseData.length === 0) {
throw new Error(`${command} response is empty`);
}
return result.responseData;
export function requirePacketResponse(result: SendPacketResult, command: string): Uint8Array {
if (!result.success) {
throw new Error(
`${command} transport failed: ${result.errorMessage || 'unknown transport error'}`,
);
}
if (!result.gotResponse || !result.responseData || result.responseData.length === 0) {
throw new Error(`${command} response is empty`);
}
return result.responseData;
}