UNPKG

2.46 kBJavaScriptView Raw
1Prism.languages.javastacktrace = {
2
3 // java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
4 // Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
5 // Caused by: com.example.myproject.MyProjectServletException
6 // Caused by: MidLevelException: LowLevelException
7 // Suppressed: Resource$CloseFailException: Resource ID = 0
8 'summary': {
9 pattern: /^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?:\:.*)?$/m,
10 inside: {
11 'keyword': {
12 pattern: /^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,
13 lookbehind: true
14 },
15
16 // the current thread if the summary starts with 'Exception in thread'
17 'string': {
18 pattern: /^(\s*)"[^"]*"/,
19 lookbehind: true
20 },
21 'exceptions': {
22 pattern: /^(:?\s*)[\w$.]+(?=:|$)/,
23 lookbehind: true,
24 inside: {
25 'class-name': /[\w$]+(?=$|:)/,
26 'namespace': /[a-z]\w*/,
27 'punctuation': /[.:]/
28 }
29 },
30 'message': {
31 pattern: /(:\s*)\S.*/,
32 lookbehind: true,
33 alias: 'string'
34 },
35 'punctuation': /[:]/
36 }
37 },
38
39 // at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
40 // at org.hsqldb.jdbc.Util.throwError(Unknown Source) here could be some notes
41 // at Util.<init>(Unknown Source)
42 'stack-frame': {
43 pattern: /^[\t ]*at [\w$.]+(?:<init>)?\([^()]*\)/m,
44 inside: {
45 'keyword': {
46 pattern: /^(\s*)at/,
47 lookbehind: true
48 },
49 'source': [
50 // (Main.java:15)
51 // (Main.scala:15)
52 {
53 pattern: /(\()\w+.\w+:\d+(?=\))/,
54 lookbehind: true,
55 inside: {
56 'file': /^\w+\.\w+/,
57 'punctuation': /:/,
58 'line-number': {
59 pattern: /\d+/,
60 alias: 'number'
61 }
62 }
63 },
64 // (Unknown Source)
65 // (Native Method)
66 // (...something...)
67 {
68 pattern: /(\()[^()]*(?=\))/,
69 lookbehind: true,
70 inside: {
71 'keyword': /^(?:Unknown Source|Native Method)$/
72 }
73 }
74 ],
75 'class-name': /[\w$]+(?=\.(?:<init>|[\w$]+)\()/,
76 'function': /(?:<init>|[\w$]+)(?=\()/,
77 'namespace': /[a-z]\w*/,
78 'punctuation': /[.()]/
79 }
80 },
81
82 // ... 32 more
83 // ... 32 common frames omitted
84 'more': {
85 pattern: /^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m,
86 inside: {
87 'punctuation': /\.{3}/,
88 'number': /\d+/,
89 'keyword': /\b[a-z]+(?: [a-z]+)*\b/
90 }
91 }
92
93};