Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: pkg/fletchc/lib/src/please_report_crash.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/fletchc/lib/src/model.dart ('k') | pkg/fletchc/lib/src/shared_command_infrastructure.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE.md file.
4
5 library fletchc.please_report_crash;
6
7 import 'guess_configuration.dart' show
8 fletchVersion;
9
10 bool crashReportRequested = false;
11
12 final String requestBugReportOnCompilerCrashMessage = """
13 The Dartino compiler is broken.
14
15 When compiling the above element, the compiler crashed. It is not
16 possible to tell if this is caused by a problem in your program or
17 not. Regardless, the compiler should not crash.
18
19 The Dartino team would greatly appreciate if you would take a moment to
20 report this problem at https://github.com/dartino/sdk/issues/new
21
22 Please include the following information:
23
24 * the name and version of your operating system
25
26 * the Dartino SDK version ($fletchVersion)
27
28 * the entire message you see here (including the full stack trace
29 below as well as the source location above)
30 """;
31
32 final String requestBugReportOnOtherCrashMessage = """
33 The Dartino program is broken and has crashed.
34
35 The Dartino team would greatly appreciate if you would take a moment to
36 report this problem at https://github.com/dartino/sdk/issues/new
37
38 Please include the following information:
39
40 * the name and version of your operating system
41
42 * the Dartino SDK version ($fletchVersion)
43
44 * the entire message you see here (including the full stack trace below)
45 """;
46
47 void pleaseReportCrash(error, StackTrace trace) {
48 String formattedError = stringifyError(error, trace);
49 if (!crashReportRequested) {
50 crashReportRequested = true;
51 print("$requestBugReportOnOtherCrashMessage$formattedError");
52 } else {
53 print(formattedError);
54 }
55 }
56
57 String stringifyError(error, StackTrace stackTrace) {
58 String safeToString(object) {
59 try {
60 return '$object';
61 } catch (e) {
62 return Error.safeToString(object);
63 }
64 }
65 StringBuffer buffer = new StringBuffer();
66 buffer.writeln(safeToString(error));
67 if (stackTrace != null) {
68 buffer.writeln(safeToString(stackTrace));
69 } else {
70 buffer.writeln("No stack trace.");
71 }
72 return '$buffer';
73 }
OLDNEW
« no previous file with comments | « pkg/fletchc/lib/src/model.dart ('k') | pkg/fletchc/lib/src/shared_command_infrastructure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698