Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab93533

Browse files
committed
Send RPC error details through to github issue. Don't show error modal for error in feedback
1 parentedff802 commitab93533

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

‎frontend/src/Feedback.js‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ import Popup from "reactjs-popup";
77

88

99
exportconstFeedbackModal=({close, error})=>{
10-
letinitialTitle,instructions;
10+
letinitialTitle,instructions,descriptionExtra;
1111
if(error){
1212
initialTitle=`Error in RPC method${error.method}`;
13+
constdetails=`
14+
Method:${error.method}
15+
Request data:${JSON.stringify(error.data,null,4)}
16+
17+
${error.traceback}
18+
`;
19+
descriptionExtra="\n\n```"+details+"```";
1320
instructions=<>
1421
<h3>Report error</h3>
1522
<p>
@@ -19,18 +26,13 @@ export const FeedbackModal = ({close, error}) => {
1926
</p>
2027
<details>
2128
<summary>Click for error details</summary>
22-
<pre>{`
23-
Method:${error.method}
24-
25-
Request data:${JSON.stringify(error.data,null,4)}
26-
27-
${error.traceback}
28-
`}</pre>
29+
<pre>{details}</pre>
2930
</details>
3031

3132
</>
3233
}else{
3334
initialTitle="";
35+
descriptionExtra="";
3436
instructions=<>
3537
<h3>Give feedback</h3>
3638
<p>Tell us what you like or don't like! If you're reporting a bug, give a detailed description of the problem:</p>
@@ -73,7 +75,7 @@ ${error.traceback}
7375
rpc("submit_feedback",
7476
{
7577
title:title.value,
76-
description:description.value,
78+
description:description.value+descriptionExtra,
7779
state:redact.store.getState(),
7880
});
7981
close();

‎frontend/src/rpc/index.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export const rpc = (method, data, onSuccess, onError) => {
1515
).then((response)=>{
1616
console.log('Finished RPC method',method);
1717
if(response.data.error){
18-
stateSet("error",{...response.data.error, method, data});
18+
if(method!=="submit_feedback"){
19+
stateSet("error",{...response.data.error, method, data});
20+
}
1921
}elseif(onSuccess){
2022
onSuccess(response.data);
2123
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp