Skip to content

Commit 923875e

Browse files
author
Greg S
committed
Fix #66: forward namespace retrieval errors for error cases
1 parent 19c50e2 commit 923875e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/infrastructure/NamespaceHttp.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ export class NamespaceHttp extends Http implements NamespaceRepository {
176176
this.namespaceRoutesApi.getNamespace(namespaceId.toHex())).pipe(
177177
map((namespaceInfoDTO) => {
178178

179+
if (namespaceInfoDTO.namespace === undefined) {
180+
throw namespaceInfoDTO;
181+
}
182+
179183
if (namespaceInfoDTO.namespace.alias.type === AliasType.Mosaic) {
180184
return new MosaicId(namespaceInfoDTO.namespace.alias.mosaicId);
181185
}
@@ -195,6 +199,10 @@ export class NamespaceHttp extends Http implements NamespaceRepository {
195199
this.namespaceRoutesApi.getNamespace(namespaceId.toHex())).pipe(
196200
map((namespaceInfoDTO) => {
197201

202+
if (namespaceInfoDTO.namespace === undefined) {
203+
throw namespaceInfoDTO;
204+
}
205+
198206
if (namespaceInfoDTO.namespace.alias.type === AliasType.Address) {
199207
return Address.createFromRawAddress(namespaceInfoDTO.namespace.alias.address);
200208
}

0 commit comments

Comments
 (0)