Allow failures on preimage (instead of swallow) (#2225)
This commit is contained in:
@@ -436,24 +436,13 @@ export default class Rpc implements RpcInterface {
|
||||
this.#storageCache.set(hexKey, value);
|
||||
|
||||
if (meta.modifier.isOptional) {
|
||||
try {
|
||||
return new Option(
|
||||
this.registry,
|
||||
createClass(this.registry, type),
|
||||
isEmpty
|
||||
? null
|
||||
: createTypeUnsafe(this.registry, type, [input], true)
|
||||
);
|
||||
} catch (error) {
|
||||
if (type === 'PreimageStatus') {
|
||||
return new Option(
|
||||
this.registry,
|
||||
createClass(this.registry, type)
|
||||
);
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
return new Option(
|
||||
this.registry,
|
||||
createClass(this.registry, type),
|
||||
isEmpty
|
||||
? null
|
||||
: createTypeUnsafe(this.registry, type, [input], true)
|
||||
);
|
||||
}
|
||||
|
||||
return createTypeUnsafe(this.registry, type, [
|
||||
|
||||
Reference in New Issue
Block a user