Skip to content

Commit 24384a3

Browse files
Merge pull request #186 from OS2iot/hotfix/better-handling-of-decoding-error
Better error handling when decoding fails
2 parents 97c383b + 3aade1a commit 24384a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/applications/datatarget/datatarget-test-connection/datatarget-test-connection.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ export class DatatargetTestConnectionComponent implements OnInit, OnDestroy {
101101
response => {
102102
this.testResponse = response?.result ? JSON.stringify(response.result, null, 2) : "";
103103
this.decodedData = response?.decodedPayload ? JSON.stringify(response.decodedPayload, null, 2) : "";
104+
this.loading = false;
104105
},
105106
error => {
106-
console.log(error);
107-
},
108-
() => {
109107
this.loading = false;
108+
this.decodedData = JSON.stringify(error.error, null, 2);
109+
this.testResponse = "";
110110
}
111111
);
112112
}

0 commit comments

Comments
 (0)