This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve error handling in new APIs
- Loading branch information
1 parent
d54914f
commit decf158
Showing
5 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,14 @@ | |
const __VERSION__ = '[email protected]'; | ||
|
||
export class BlockDetailView { | ||
asVersion(rawData, version) { | ||
asVersion(rawData, __errors__, version) { | ||
if (__errors__) { | ||
return { | ||
__VERSION__, | ||
__errors__, | ||
}; | ||
} | ||
|
||
const entries = rawData.entries; | ||
const blockData = rawData.block; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,14 @@ import _ from 'lodash'; | |
*/ | ||
const __VERSION__ = '[email protected]'; | ||
export class BlockIndexView { | ||
asVersion(rawData, version) { | ||
asVersion(rawData, __errors__, version) { | ||
if (__errors__) { | ||
return { | ||
__VERSION__, | ||
__errors__, | ||
}; | ||
} | ||
|
||
const timelineData = rawData.timelinePage; | ||
const timelineInfo = rawData.timelineInfo; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,14 @@ import _ from 'lodash'; | |
*/ | ||
const __VERSION__ = '[email protected]'; | ||
export class TransactionDetailView { | ||
asVersion(rawData, version) { | ||
asVersion(rawData, __errors__, version) { | ||
if (__errors__) { | ||
return { | ||
__VERSION__, | ||
__errors__, | ||
}; | ||
} | ||
|
||
const transactionData = rawData.transaction; | ||
const entryData = rawData.entry; | ||
const blockData = rawData.block; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,14 @@ import _ from 'lodash'; | |
*/ | ||
const __VERSION__ = '[email protected]'; | ||
export class TransactionIndexView { | ||
asVersion(rawData, version) { | ||
asVersion(rawData, __errors__, version) { | ||
if (__errors__) { | ||
return { | ||
__VERSION__, | ||
__errors__, | ||
}; | ||
} | ||
|
||
const timelineData = rawData.timelinePage; | ||
const timelineInfo = rawData.timelineInfo; | ||
|
||
|