Skip to content

Commit 722f11c

Browse files
committed
adding json info into conflict message
1 parent 830e718 commit 722f11c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/tdb-dashboard/src/components/utils.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,12 @@ export function sortAlphabetically (list, byID) {
320320
})
321321
}
322322

323+
// function which displays CR Conflict errors
324+
export function getCRConflictError (errorData) {
325+
let message = "It looks like there are conflicts, fix these conflicts and then update or exit the Change Request"
326+
return <div>
327+
{message}
328+
<pre>{JSON.stringify(errorData, null, 2)}</pre>
329+
</div>
330+
}
331+

packages/tdb-dashboard/src/hooks/hookUtils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { localSettings } from "../../localSettings";
2+
import { getCRConflictError } from "../components/utils"
23
export function getOptions(token){
34

45
const options = {
@@ -46,7 +47,7 @@ export function formatErrorMessage (err){
4647
message = "Network Error"
4748
}
4849
else if (err.data && err.data["api:status"] && err.data["api:status"]==="api:conflict") {
49-
message = "It looks like there is a conflict, fix conflicts and then update Change Request or exit the Change Request"
50+
message = getCRConflictError(err.data["api:witnesses"])
5051
}
5152
return message
5253
}

0 commit comments

Comments
 (0)