-import { ProcedureName, ResponseStatus, type RequestPayload } from '@/types/UIProtocol';
-import type { ProtocolResponse, ResponsePayload } from '@/types/UIProtocol';
-
import Utils from './Utils';
+import {
+ ProcedureName,
+ type ProtocolResponse,
+ type RequestPayload,
+ type ResponsePayload,
+ ResponseStatus,
+} from '@/types/UIProtocol';
import config from '@/assets/config';
type ResponseHandler = {
const response = JSON.parse(messageEvent.data) as ProtocolResponse;
if (Array.isArray(response) === false) {
- throw new Error('Response not an array: ' + JSON.stringify(response, null, 2));
+ throw new Error(`Response not an array: ${JSON.stringify(response, null, 2)}`);
}
const [uuid, responsePayload] = response;
}
this.deleteResponseHandler(uuid);
} else {
- throw new Error('Not a response to a request: ' + JSON.stringify(response, null, 2));
+ throw new Error(`Not a response to a request: ${JSON.stringify(response, null, 2)}`);
}
}
}