Add support for Java stack traces (#1520)
There are 3 main types of elements which are highlighted: 1. The summary. This is the head of the stack trace and includes the name of the exception and a message. `Exception in thread "main" java.lang.RuntimeException: A test exception` 2. Stack frames. These make up the actual stack trace and include the full name of the method and the source. `at com.stackify.stacktrace.StackTraceExample.methodB(StackTraceExample.java:13)` 3. Omitted frames. This is a simple message that some frames were omitted. `... 27 more` Everything besides these 3 element types will not be highlighted.
This commit is contained in:
parent
a69c2b6259
commit
4a8219a43d
File diff suppressed because one or more lines are too long
|
@ -382,6 +382,10 @@
|
|||
"require": "clike",
|
||||
"owner": "sherblot"
|
||||
},
|
||||
"javastacktrace": {
|
||||
"title": "Java stack trace",
|
||||
"owner": "RunDevelopment"
|
||||
},
|
||||
"jolie": {
|
||||
"title": "Jolie",
|
||||
"require": "clike",
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
Prism.languages.javastacktrace = {
|
||||
|
||||
// java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
||||
// Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
||||
// Caused by: com.example.myproject.MyProjectServletException
|
||||
// Caused by: MidLevelException: LowLevelException
|
||||
// Suppressed: Resource$CloseFailException: Resource ID = 0
|
||||
'summary': {
|
||||
pattern: /^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?:\:.*)?$/m,
|
||||
inside: {
|
||||
'keyword': {
|
||||
pattern: /^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,
|
||||
lookbehind: true
|
||||
},
|
||||
|
||||
// the current thread if the summary starts with 'Exception in thread'
|
||||
'string': {
|
||||
pattern: /^(\s*)"[^"]*"/,
|
||||
lookbehind: true
|
||||
},
|
||||
'exceptions': {
|
||||
pattern: /^(:?\s*)[\w$.]+(?=:|$)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'class-name': /[\w$]+(?=$|:)/,
|
||||
'namespace': /[a-z]\w*/,
|
||||
'punctuation': /[.:]/
|
||||
}
|
||||
},
|
||||
'message': {
|
||||
pattern: /(:\s*)\S.*/,
|
||||
lookbehind: true,
|
||||
alias: 'string'
|
||||
},
|
||||
'punctuation': /[:]/
|
||||
}
|
||||
},
|
||||
|
||||
// at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
|
||||
// at org.hsqldb.jdbc.Util.throwError(Unknown Source) here could be some notes
|
||||
// at Util.<init>(Unknown Source)
|
||||
'stack-frame': {
|
||||
pattern: /^[\t ]*at [\w$.]+(?:<init>)?\([^()]*\)/m,
|
||||
inside: {
|
||||
'keyword': {
|
||||
pattern: /^(\s*)at/,
|
||||
lookbehind: true
|
||||
},
|
||||
'source': [
|
||||
// (Main.java:15)
|
||||
// (Main.scala:15)
|
||||
{
|
||||
pattern: /(\()\w+.\w+:\d+(?=\))/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'file': /^\w+\.\w+/,
|
||||
'punctuation': /:/,
|
||||
'line-number': {
|
||||
pattern: /\d+/,
|
||||
alias: 'number'
|
||||
}
|
||||
}
|
||||
},
|
||||
// (Unknown Source)
|
||||
// (Native Method)
|
||||
// (...something...)
|
||||
{
|
||||
pattern: /(\()[^()]*(?=\))/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'keyword': /^(?:Unknown Source|Native Method)$/
|
||||
}
|
||||
}
|
||||
],
|
||||
'class-name': /[\w$]+(?=\.(?:<init>|[\w$]+)\()/,
|
||||
'function': /(?:<init>|[\w$]+)(?=\()/,
|
||||
'namespace': /[a-z]\w*/,
|
||||
'punctuation': /[.()]/
|
||||
}
|
||||
},
|
||||
|
||||
// ... 32 more
|
||||
// ... 32 common frames omitted
|
||||
'more': {
|
||||
pattern: /^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m,
|
||||
inside: {
|
||||
'punctuation': /\.{3}/,
|
||||
'number': /\d+/,
|
||||
'keyword': /\b[a-z]+(?: [a-z]+)*\b/
|
||||
}
|
||||
}
|
||||
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
Prism.languages.javastacktrace={summary:{pattern:/^[\t ]*(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?:\:.*)?$/m,inside:{keyword:{pattern:/^(\s*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+(?=$|:)/,namespace:/[a-z]\w*/,punctuation:/[.:]/}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/[:]/}},"stack-frame":{pattern:/^[\t ]*at [\w$.]+(?:<init>)?\([^()]*\)/m,inside:{keyword:{pattern:/^(\s*)at/,lookbehind:!0},source:[{pattern:/(\()\w+.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\d+/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Unknown Source|Native Method)$/}}],"class-name":/[\w$]+(?=\.(?:<init>|[\w$]+)\()/,"function":/(?:<init>|[\w$]+)(?=\()/,namespace:/[a-z]\w*/,punctuation:/[.()]/}},more:{pattern:/^[\t ]*\.{3} \d+ [a-z]+(?: [a-z]+)*/m,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}};
|
|
@ -0,0 +1,63 @@
|
|||
<h2>Full example</h2>
|
||||
<pre><code>javax.servlet.ServletException: Something bad happened
|
||||
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:60)
|
||||
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
||||
at com.example.myproject.ExceptionHandlerFilter.doFilter(ExceptionHandlerFilter.java:28)
|
||||
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
||||
at com.example.myproject.OutputBufferFilter.doFilter(OutputBufferFilter.java:33)
|
||||
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
|
||||
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
|
||||
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
|
||||
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
|
||||
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
|
||||
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
|
||||
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
|
||||
at org.mortbay.jetty.Server.handle(Server.java:326)
|
||||
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
|
||||
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
|
||||
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
|
||||
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
|
||||
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
|
||||
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
|
||||
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
|
||||
Caused by: com.example.myproject.MyProjectServletException
|
||||
at com.example.myproject.MyServlet.doPost(MyServlet.java:169)
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
|
||||
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
|
||||
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
|
||||
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
|
||||
at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:30)
|
||||
... 27 more
|
||||
Suppressed: org.hibernate.exception.ConstraintViolationException: could not insert: [com.example.myproject.MyEntity]
|
||||
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:96)
|
||||
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
|
||||
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:64)
|
||||
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2329)
|
||||
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2822)
|
||||
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
|
||||
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:268)
|
||||
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
|
||||
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
|
||||
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
|
||||
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
|
||||
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
|
||||
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
|
||||
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
|
||||
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
|
||||
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:705)
|
||||
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:693)
|
||||
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:689)
|
||||
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
|
||||
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
||||
at java.lang.reflect.Method.invoke(Method.java:597)
|
||||
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:344)
|
||||
at $Proxy19.save(Unknown Source)
|
||||
at com.example.myproject.MyEntityService.save(MyEntityService.java:59) <-- relevant call (see notes below)
|
||||
at com.example.myproject.MyServlet.doPost(MyServlet.java:164)
|
||||
... 32 more
|
||||
Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
||||
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
|
||||
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
|
||||
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105)
|
||||
at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:57)
|
||||
... 54 more</code></pre>
|
|
@ -11,7 +11,7 @@ if (!Prism.plugins.toolbar) {
|
|||
}
|
||||
|
||||
// The languages map is built automatically with gulp
|
||||
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","arff":"ARFF","asciidoc":"AsciiDoc","asm6502":"6502 Assembly","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","autoit":"AutoIt","shell":"Shell","basic":"BASIC","csharp":"C#","cpp":"C++","cil":"CIL","coffeescript":"CoffeeScript","csp":"Content-Security-Policy","css-extras":"CSS Extras","django":"Django/Jinja2","erb":"ERB","fsharp":"F#","gcode":"G-code","gedcom":"GEDCOM","glsl":"GLSL","gml":"GameMaker Language","graphql":"GraphQL","http":"HTTP","hpkp":"HTTP Public-Key-Pins","hsts":"HTTP Strict-Transport-Security","ichigojam":"IchigoJam","inform7":"Inform 7","json":"JSON","jsonp":"JSONP","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","markup-templating":"Markup templating","matlab":"MATLAB","mel":"MEL","n4js":"N4JS","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","opencl":"OpenCL","parigp":"PARI/GP","objectpascal":"Object Pascal","php":"PHP","php-extras":"PHP Extras","plsql":"PL/SQL","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","q":"Q (kdb+ database)","jsx":"React JSX","tsx":"React TSX","renpy":"Ren'py","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","soy":"Soy (Closure Template)","tap":"TAP","toml":"TOML","tt2":"Template Toolkit 2","typescript":"TypeScript","vbnet":"VB.Net","vhdl":"VHDL","vim":"vim","visual-basic":"Visual Basic","wasm":"WebAssembly","wiki":"Wiki markup","xeoracube":"XeoraCube","xojo":"Xojo (REALbasic)","xquery":"XQuery","yaml":"YAML"}/*]*/;
|
||||
var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","arff":"ARFF","asciidoc":"AsciiDoc","asm6502":"6502 Assembly","aspnet":"ASP.NET (C#)","autohotkey":"AutoHotkey","autoit":"AutoIt","shell":"Shell","basic":"BASIC","csharp":"C#","cpp":"C++","cil":"CIL","coffeescript":"CoffeeScript","csp":"Content-Security-Policy","css-extras":"CSS Extras","django":"Django/Jinja2","erb":"ERB","fsharp":"F#","gcode":"G-code","gedcom":"GEDCOM","glsl":"GLSL","gml":"GameMaker Language","graphql":"GraphQL","http":"HTTP","hpkp":"HTTP Public-Key-Pins","hsts":"HTTP Strict-Transport-Security","ichigojam":"IchigoJam","inform7":"Inform 7","javastacktrace":"Java stack trace","json":"JSON","jsonp":"JSONP","latex":"LaTeX","livescript":"LiveScript","lolcode":"LOLCODE","markup-templating":"Markup templating","matlab":"MATLAB","mel":"MEL","n4js":"N4JS","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","opencl":"OpenCL","parigp":"PARI/GP","objectpascal":"Object Pascal","php":"PHP","php-extras":"PHP Extras","plsql":"PL/SQL","powershell":"PowerShell","properties":".properties","protobuf":"Protocol Buffers","q":"Q (kdb+ database)","jsx":"React JSX","tsx":"React TSX","renpy":"Ren'py","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","soy":"Soy (Closure Template)","tap":"TAP","toml":"TOML","tt2":"Template Toolkit 2","typescript":"TypeScript","vbnet":"VB.Net","vhdl":"VHDL","vim":"vim","visual-basic":"Visual Basic","wasm":"WebAssembly","wiki":"Wiki markup","xeoracube":"XeoraCube","xojo":"Xojo (REALbasic)","xquery":"XQuery","yaml":"YAML"}/*]*/;
|
||||
Prism.plugins.toolbar.registerButton('show-language', function(env) {
|
||||
var pre = env.element.parentNode;
|
||||
if (!pre || !/pre/i.test(pre.nodeName)) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){if(!Prism.plugins.toolbar)return console.warn("Show Languages plugin loaded before Toolbar plugin."),void 0;var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",arff:"ARFF",asciidoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",shell:"Shell",basic:"BASIC",csharp:"C#",cpp:"C++",cil:"CIL",coffeescript:"CoffeeScript",csp:"Content-Security-Policy","css-extras":"CSS Extras",django:"Django/Jinja2",erb:"ERB",fsharp:"F#",gcode:"G-code",gedcom:"GEDCOM",glsl:"GLSL",gml:"GameMaker Language",graphql:"GraphQL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",inform7:"Inform 7",json:"JSON",jsonp:"JSONP",latex:"LaTeX",livescript:"LiveScript",lolcode:"LOLCODE","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",n4js:"N4JS",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",php:"PHP","php-extras":"PHP Extras",plsql:"PL/SQL",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",q:"Q (kdb+ database)",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",soy:"Soy (Closure Template)",tap:"TAP",toml:"TOML",tt2:"Template Toolkit 2",typescript:"TypeScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(a){var t=a.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var s=t.getAttribute("data-language")||e[a.language]||a.language&&a.language.substring(0,1).toUpperCase()+a.language.substring(1);if(s){var i=document.createElement("span");return i.textContent=s,i}}})}}();
|
||||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){if(!Prism.plugins.toolbar)return console.warn("Show Languages plugin loaded before Toolbar plugin."),void 0;var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",arff:"ARFF",asciidoc:"AsciiDoc",asm6502:"6502 Assembly",aspnet:"ASP.NET (C#)",autohotkey:"AutoHotkey",autoit:"AutoIt",shell:"Shell",basic:"BASIC",csharp:"C#",cpp:"C++",cil:"CIL",coffeescript:"CoffeeScript",csp:"Content-Security-Policy","css-extras":"CSS Extras",django:"Django/Jinja2",erb:"ERB",fsharp:"F#",gcode:"G-code",gedcom:"GEDCOM",glsl:"GLSL",gml:"GameMaker Language",graphql:"GraphQL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",inform7:"Inform 7",javastacktrace:"Java stack trace",json:"JSON",jsonp:"JSONP",latex:"LaTeX",livescript:"LiveScript",lolcode:"LOLCODE","markup-templating":"Markup templating",matlab:"MATLAB",mel:"MEL",n4js:"N4JS",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",parigp:"PARI/GP",objectpascal:"Object Pascal",php:"PHP","php-extras":"PHP Extras",plsql:"PL/SQL",powershell:"PowerShell",properties:".properties",protobuf:"Protocol Buffers",q:"Q (kdb+ database)",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",soy:"Soy (Closure Template)",tap:"TAP",toml:"TOML",tt2:"Template Toolkit 2",typescript:"TypeScript",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",wasm:"WebAssembly",wiki:"Wiki markup",xeoracube:"XeoraCube",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML"};Prism.plugins.toolbar.registerButton("show-language",function(a){var t=a.element.parentNode;if(t&&/pre/i.test(t.nodeName)){var s=t.getAttribute("data-language")||e[a.language]||a.language&&a.language.substring(0,1).toUpperCase()+a.language.substring(1);if(s){var r=document.createElement("span");return r.textContent=s,r}}})}}();
|
|
@ -0,0 +1,22 @@
|
|||
... 6 more
|
||||
... 6 common frames omitted
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["more", [
|
||||
["punctuation", "..."],
|
||||
["number", "6"],
|
||||
["keyword", "more"]
|
||||
]],
|
||||
|
||||
["more", [
|
||||
["punctuation", "..."],
|
||||
["number", "6"],
|
||||
["keyword", "common frames omitted"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for the message that some frames were omitted.
|
|
@ -0,0 +1,71 @@
|
|||
at Main.main(Main.java:13)
|
||||
at Main.main(Main.java:13) Same but with some additional notes
|
||||
at com.foo.bar.Main$FooBar.main(Native Method)
|
||||
at Main$FooBar.<init>(Unknown Source)
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["stack-frame", [
|
||||
["keyword", "at"],
|
||||
["class-name", "Main"],
|
||||
["punctuation", "."],
|
||||
["function", "main"],
|
||||
["punctuation", "("],
|
||||
["source", [
|
||||
["file", "Main.java"],
|
||||
["punctuation", ":"],
|
||||
["line-number", "13"]
|
||||
]],
|
||||
["punctuation", ")"]
|
||||
]],
|
||||
|
||||
["stack-frame", [
|
||||
["keyword", "at"],
|
||||
["class-name", "Main"],
|
||||
["punctuation", "."],
|
||||
["function", "main"],
|
||||
["punctuation", "("],
|
||||
["source", [
|
||||
["file", "Main.java"],
|
||||
["punctuation", ":"],
|
||||
["line-number", "13"]
|
||||
]],
|
||||
["punctuation", ")"]
|
||||
]],
|
||||
" Same but with some additional notes\n",
|
||||
|
||||
["stack-frame", [
|
||||
["keyword", "at"],
|
||||
["namespace", "com"],
|
||||
["punctuation", "."],
|
||||
["namespace", "foo"],
|
||||
["punctuation", "."],
|
||||
["namespace", "bar"],
|
||||
["punctuation", "."],
|
||||
["class-name", "Main$FooBar"],
|
||||
["punctuation", "."],
|
||||
["function", "main"],
|
||||
["punctuation", "("],
|
||||
["source", [
|
||||
["keyword", "Native Method"]
|
||||
]],
|
||||
["punctuation", ")"]
|
||||
]],
|
||||
|
||||
["stack-frame", [
|
||||
["keyword", "at"],
|
||||
["class-name", "Main$FooBar"],
|
||||
["punctuation", "."],
|
||||
["function", "<init>"],
|
||||
["punctuation", "("],
|
||||
["source", [
|
||||
["keyword", "Unknown Source"]
|
||||
]],
|
||||
["punctuation", ")"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for stack frames.
|
|
@ -0,0 +1,155 @@
|
|||
java.lang.NullPointerException
|
||||
java.lang.NullPointerException: This is bad
|
||||
HighLevelException: MidLevelException: LowLevelException
|
||||
HighLevelException: MidLevelException: LowLevelException: This is bad
|
||||
|
||||
Exception in thread "main" java.lang.RuntimeException: A test exception
|
||||
Exception in thread "main" HighLevelException: MidLevelException: LowLevelException: This is bad
|
||||
|
||||
Caused by: Exception: This also includes causes and suppressed exceptions
|
||||
Caused by: MidLevelException: LowLevelException
|
||||
Caused by: com.example.myproject.MyProjectServletException
|
||||
|
||||
Suppressed: java.lang.RuntimeException: could not insert: [com.example.myproject.MyEntity]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["summary", [
|
||||
["exceptions", [
|
||||
["namespace", "java"],
|
||||
["punctuation", "."],
|
||||
["namespace", "lang"],
|
||||
["punctuation", "."],
|
||||
["class-name", "NullPointerException"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["exceptions", [
|
||||
["namespace", "java"],
|
||||
["punctuation", "."],
|
||||
["namespace", "lang"],
|
||||
["punctuation", "."],
|
||||
["class-name", "NullPointerException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["message", "This is bad"]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["exceptions", [
|
||||
["class-name", "HighLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "MidLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "LowLevelException"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["exceptions", [
|
||||
["class-name", "HighLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "MidLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "LowLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["message", "This is bad"]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["keyword", "Exception in thread"],
|
||||
["string", "\"main\""],
|
||||
["exceptions", [
|
||||
["namespace", "java"],
|
||||
["punctuation", "."],
|
||||
["namespace", "lang"],
|
||||
["punctuation", "."],
|
||||
["class-name", "RuntimeException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["message", "A test exception"]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["keyword", "Exception in thread"],
|
||||
["string", "\"main\""],
|
||||
["exceptions", [
|
||||
["class-name", "HighLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "MidLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "LowLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["message", "This is bad"]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["keyword", "Caused by"],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "Exception"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["message", "This also includes causes and suppressed exceptions"]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["keyword", "Caused by"],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "MidLevelException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["class-name", "LowLevelException"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["keyword", "Caused by"],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["namespace", "com"],
|
||||
["punctuation", "."],
|
||||
["namespace", "example"],
|
||||
["punctuation", "."],
|
||||
["namespace", "myproject"],
|
||||
["punctuation", "."],
|
||||
["class-name", "MyProjectServletException"]
|
||||
]]
|
||||
]],
|
||||
|
||||
["summary", [
|
||||
["keyword", "Suppressed"],
|
||||
["punctuation", ":"],
|
||||
["exceptions", [
|
||||
["namespace", "java"],
|
||||
["punctuation", "."],
|
||||
["namespace", "lang"],
|
||||
["punctuation", "."],
|
||||
["class-name", "RuntimeException"]
|
||||
]],
|
||||
["punctuation", ":"],
|
||||
["message", "could not insert: [com.example.myproject.MyEntity]"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for exception summaries.
|
Loading…
Reference in New Issue