prism-javastacktrace.js 2.4 KB

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