File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/sqitch-parser/src/plan Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,8 @@ function parseTagLine(line: string, lastChangeName: string | null): Tag | null {
157157 // Remove the @ and parse
158158 const tagContent = line . substring ( 1 ) ;
159159 // Tag format: tagname timestamp planner <email> # comment
160- const regex = / ^ ( \S + ) \s + ( \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } Z ) \s + ( \S + ) \s + < ( [ ^ > ] + ) > (?: \s + # \s + ( .* ) ) ? $ / ;
160+ // Updated regex to handle planner names with spaces
161+ const regex = / ^ ( \S + ) \s + ( \d { 4 } - \d { 2 } - \d { 2 } T \d { 2 } : \d { 2 } : \d { 2 } Z ) \s + ( .+ ?) \s + < ( [ ^ > ] + ) > (?: \s + # \s + ( .* ) ) ? $ / ;
161162
162163 const match = tagContent . match ( regex ) ;
163164 if ( ! match ) {
@@ -284,7 +285,13 @@ export function parsePlanFileSimple(planPath: string): PlanFile {
284285 return planWithoutTags ;
285286 }
286287
287- // Return empty plan on error
288+ // If there are errors, throw with details
289+ if ( result . errors && result . errors . length > 0 ) {
290+ const errorMessages = result . errors . map ( e => `Line ${ e . line } : ${ e . message } ` ) . join ( '\n' ) ;
291+ throw new Error ( `Failed to parse plan file ${ planPath } :\n${ errorMessages } ` ) ;
292+ }
293+
294+ // Return empty plan if no data and no errors
288295 return { project : '' , uri : '' , changes : [ ] } ;
289296}
290297
You can’t perform that action at this time.
0 commit comments