Skip to content

Commit 20be95d

Browse files
committed
added detail to error message to encourage bug reports to include necessary detail
1 parent 7f16b38 commit 20be95d

4 files changed

Lines changed: 42 additions & 42 deletions

File tree

lib/src/state/app_state.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
2929
if (this.maybe_design != null) {
3030
return this.maybe_design!;
3131
} else {
32-
throw AssertionError("""\
33-
You have discovered a bug in scadnano.
34-
35-
Please file a bug report at https://github.com/UC-Davis-molecular-computing/scadnano/issues.
36-
Include as much detail as possible, including any information currently displayed
37-
in the app. Thank you!""");
32+
throw AssertionError(util.ASSERTION_ERROR_MESSAGE);
3833
}
3934
}
4035

lib/src/util.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ import 'state/selection_box.dart';
5656
import 'state/strand.dart';
5757
import 'actions/actions.dart' as actions;
5858

59-
const ASSERTION_ERROR_MESSAGE = 'You have discovered a bug. Please send this entire error message to\n'
60-
' ${constants.BUG_REPORT_URL}';
59+
const ASSERTION_ERROR_MESSAGE = '''
60+
You have discovered a bug. Please file a bug report as a GitHub issue at
61+
${constants.BUG_REPORT_URL}
62+
Please include as much detail as possible. For instance, it is helpful to upload the design
63+
you were working on, as well as indicating the steps to reproduce the error. Please also
64+
into the bug report any additional error information displayed in the app. Thank you!''';
6165

6266
/////////////////////////////////////////////////////////////////////////////
6367
// interop between Dart and JS
@@ -1238,7 +1242,9 @@ String stack_trace_message_bug_report(stack_trace) {
12381242
'\n**********************************************************************************'
12391243
'\n* If you believe this is due to a bug in scadnano, please file a bug report at *'
12401244
'\n* ${constants.BUG_REPORT_URL}${' ' * (77 - constants.BUG_REPORT_URL.length)}*'
1241-
'\n* Include this entire message in the email. *'
1245+
'\n* Include this entire message in the email, as well as any detail that may help *'
1246+
'\n* us, including uploading the scadnano design, as well as indicating steps to *'
1247+
'\n* help us to reproduce the error. *'
12421248
'\n**********************************************************************************'
12431249
'\n\nstack trace:'
12441250
'\n${stack_trace}';

lib/src/view/design_main_error_boundary.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:over_react/src/component/error_boundary_recoverable.dart';
77
import '../app.dart';
88
import '../constants.dart' as constants;
99
import '../actions/actions.dart' as actions;
10+
import '../util.dart' as util;
1011

1112
part 'design_main_error_boundary.over_react.g.dart';
1213

@@ -61,11 +62,9 @@ class DesignMainErrorBoundaryComponent<T extends DesignMainErrorBoundaryProps,
6162
if (state.hasError) {
6263
var error = state.error;
6364
// var escaper = HtmlEscape();
64-
var escaped_error_message = 'You have discovered a bug in scadnano. '
65-
'Please file a bug report as a GitHub issue at\n'
66-
' ${constants.BUG_REPORT_URL}\n'
67-
'and include the following information:\n\n'
68-
'${error.toString()}\n\nstack trace:\n${error.stackTrace}' //escaper.convert(
65+
var escaped_error_message = util.ASSERTION_ERROR_MESSAGE +
66+
'\n\n' +
67+
'${error.toString()}\n\nstack trace:\n${error.stackTrace}' //escaper.convert(
6968
// )
7069
;
7170

pubspec.lock

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ packages:
55
dependency: transitive
66
description:
77
name: _fe_analyzer_shared
8-
sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab"
8+
sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "76.0.0"
11+
version: "73.0.0"
1212
_macros:
1313
dependency: transitive
1414
description: dart
1515
source: sdk
16-
version: "0.3.3"
16+
version: "0.3.2"
1717
analyzer:
1818
dependency: "direct main"
1919
description:
2020
name: analyzer
21-
sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e"
21+
sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a"
2222
url: "https://pub.dev"
2323
source: hosted
24-
version: "6.11.0"
24+
version: "6.8.0"
2525
archive:
2626
dependency: transitive
2727
description:
@@ -66,74 +66,74 @@ packages:
6666
dependency: transitive
6767
description:
6868
name: build
69-
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
69+
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
7070
url: "https://pub.dev"
7171
source: hosted
72-
version: "2.4.2"
72+
version: "2.4.1"
7373
build_config:
7474
dependency: transitive
7575
description:
7676
name: build_config
77-
sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33"
77+
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
7878
url: "https://pub.dev"
7979
source: hosted
80-
version: "1.1.2"
80+
version: "1.1.1"
8181
build_daemon:
8282
dependency: transitive
8383
description:
8484
name: build_daemon
85-
sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948"
85+
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
8686
url: "https://pub.dev"
8787
source: hosted
88-
version: "4.0.3"
88+
version: "4.0.2"
8989
build_modules:
9090
dependency: transitive
9191
description:
9292
name: build_modules
93-
sha256: "5d95f6a500e3cb27eebfb5d264c683ca658fcb39ef73ee403595d7a2b2955a44"
93+
sha256: "403ba034d94f1a0f26362fe14fd83e9ff33644f5cbe879982920e3d209650b43"
9494
url: "https://pub.dev"
9595
source: hosted
96-
version: "5.0.10"
96+
version: "5.0.9"
9797
build_resolvers:
9898
dependency: transitive
9999
description:
100100
name: build_resolvers
101-
sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e"
101+
sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a"
102102
url: "https://pub.dev"
103103
source: hosted
104-
version: "2.4.3"
104+
version: "2.4.2"
105105
build_runner:
106106
dependency: "direct dev"
107107
description:
108108
name: build_runner
109-
sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573"
109+
sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d"
110110
url: "https://pub.dev"
111111
source: hosted
112-
version: "2.4.14"
112+
version: "2.4.13"
113113
build_runner_core:
114114
dependency: transitive
115115
description:
116116
name: build_runner_core
117-
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
117+
sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0
118118
url: "https://pub.dev"
119119
source: hosted
120-
version: "8.0.0"
120+
version: "7.3.2"
121121
build_test:
122122
dependency: "direct dev"
123123
description:
124124
name: build_test
125-
sha256: a580c76c28440d0006b75c6746bbbb3c1648959ba9e1afae2c2b0f2c26acdf3d
125+
sha256: "260dbba934f41b0a42935e9cae1f5731b94f0c3e489dc97bcf8e281265aaa5ae"
126126
url: "https://pub.dev"
127127
source: hosted
128-
version: "2.2.3"
128+
version: "2.2.2"
129129
build_web_compilers:
130130
dependency: "direct dev"
131131
description:
132132
name: build_web_compilers
133-
sha256: "75a3ce1cd97d2bb13bc0d7321570c390ef795304ca3c6a635716fd9902587a68"
133+
sha256: e8d818410cc8b4dc96c4960ce0ab84fe3f2b0ca6576cc130fd7277b56eba9d68
134134
url: "https://pub.dev"
135135
source: hosted
136-
version: "4.1.0"
136+
version: "4.0.11"
137137
built_collection:
138138
dependency: "direct main"
139139
description:
@@ -154,10 +154,10 @@ packages:
154154
dependency: "direct dev"
155155
description:
156156
name: built_value_generator
157-
sha256: "6ba3effca656e7f88102142e7d62b71373504d654132ca2895896b3a7013e567"
157+
sha256: bb06c5e9dbdbd35ed6de21520e2e5112582c964fa584e2a4bb59887fc7a169b0
158158
url: "https://pub.dev"
159159
source: hosted
160-
version: "8.9.3"
160+
version: "8.9.2"
161161
checked_yaml:
162162
dependency: transitive
163163
description:
@@ -370,10 +370,10 @@ packages:
370370
dependency: transitive
371371
description:
372372
name: macros
373-
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
373+
sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536"
374374
url: "https://pub.dev"
375375
source: hosted
376-
version: "0.1.3-main.0"
376+
version: "0.1.2-main.4"
377377
matcher:
378378
dependency: transitive
379379
description:
@@ -799,4 +799,4 @@ packages:
799799
source: hosted
800800
version: "3.1.3"
801801
sdks:
802-
dart: ">=3.6.0 <3.7.0-z"
802+
dart: ">=3.5.0 <3.7.0"

0 commit comments

Comments
 (0)