lint
This commit is contained in:
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;
|
||||
}
|
||||
Reference in new issue
Block a user