Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
metadataPush(payload: Payload): Single {
let error: ?Error;
if (this._responder.metadataPush) {
try {
return this._responder.metadataPush(payload);
} catch (_error) {
console.error('metadataPush threw an exception', _error);
error = _error;
}
}
return Single.error(error || new Error('not implemented'));
}
}
requestResponse(payload: Payload): Single> {
let error: ?Error;
if (this._responder.requestResponse) {
try {
return this._responder.requestResponse(payload);
} catch (_error) {
console.error('requestResponse threw an exception', _error);
error = _error;
}
}
return Single.error(error || new Error('not implemented'));
}
metadataPush(payload): Single {
logRequest('metadataPush', payload);
return Single.error(new Error());
}
}
metadataPush(payload): Single {
logRequest('metadataPush', payload);
return Single.error(new Error());
}
}
requestResponse(payload): Single> {
logRequest('requestResponse', payload);
return Single.error(new Error());
}
metadataPush(payload: Payload): Single {
return Single.error(new Error('metadataPush() is not implemented'));
}
}
metadataPush(payload: Payload): Single {
return Single.error(new Error('metadataPush() is not implemented'));
}
}
): Single> {
try {
if (payload.metadata == null) {
return Single.error(new Error('metadata is empty'));
}
const service = getService(payload.metadata);
const handler = this._registeredServices.get(service);
if (handler == null) {
return Single.error(new Error('can not find service ' + service));
}
return handler.requestResponse(payload);
} catch (error) {
return Single.error(error);
}
}
requestResponse(
payload: Payload,
): Single> {
try {
if (payload.metadata == null) {
return Single.error(new Error('metadata is empty'));
}
const service = getService(payload.metadata);
const handler = this._registeredServices.get(service);
if (handler == null) {
return Single.error(new Error('can not find service ' + service));
}
return handler.requestResponse(payload);
} catch (error) {
return Single.error(error);
}
}
requestResponse(payload): Single> {
logRequest('requestResponse', payload);
return Single.error(new Error());
}