This repository was archived by the owner on Dec 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
app/plugins/modules/editor/lib Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,17 @@ const persisters = {
156156 . catch ( err => {
157157 if ( err . statusCode === 'ENOPARSE' ) {
158158 debug ( 'composition did not parse' , err )
159+ // try two patterns to spot stack trace information;
160+ // we need to pull out the line number from the stack trace,
161+ // so that we can identify the problem, with a gutter marker ("decoration"),
162+ // in the editor pane
159163 const basename = path . basename ( filepath ) ,
160- pattern = new RegExp ( '\\n([^\n]+)\\n\\s+at\\s+' + basename . replace ( / \. / , '\\.' ) + ':(\\d+):(\\d+)' ) ,
161- match = err . message . match ( pattern )
164+ pattern1 = new RegExp ( '\\n([^\n]+)\\n\\s+at\\s+' + basename . replace ( / \. / , '\\.' ) + ':(\\d+):(\\d+)' ) ,
162165
163- debug ( 'pattern' , pattern )
166+ pattern2 = new RegExp ( '([^\n]+)\\n\\s+at\\s+[^\\(]*\\s+\\([^\n\r]*' + basename . replace ( / \. / , '\\.' ) + ':(\\d+):(\\d+)' ) ,
167+ match = err . message . match ( pattern1 ) || err . message . match ( pattern2 )
168+
169+ debug ( 'pattern' , pattern1 , pattern2 )
164170 debug ( 'message' , err . message )
165171 if ( match ) {
166172 const problem = match [ 1 ] ,
You can’t perform that action at this time.
0 commit comments