@@ -231,10 +231,10 @@ function tryToFormatError(err0)
231231 local err , path , ln = nil
232232
233233 if type (err0 ) == " string" then
234- path , ln , err = err0 :match ' ^(.- ):(%d+): (.*)'
235- if not err then
236- path , ln , err = err0 :match ' ^([%w_/.]+ ):(%d+): (.*)'
237- end
234+ do path , ln , err = err0 :match ' ^(%a:[%w_/ \\ .]+ ):(%d+): (.*)'
235+ if not err then path , ln , err = err0 : match ' ^([%w_/ \\ .]+):(%d+): (.*) '
236+ if not err then path , ln , err = err0 :match ' ^(.- ):(%d+): (.*)'
237+ end end end
238238 end
239239
240240 if err then
10731073 table.insert (errorHandlers , errHand )
10741074 currentErrorHandler = errHand
10751075 end
1076- function pushErrorHandlerIfOverridingDefault (errHand )
1077- pushErrorHandler (currentErrorHandler == _error and errHand or currentErrorHandler )
1078- end
1076+ -- function pushErrorHandlerIfOverridingDefault(errHand) -- Unused.
1077+ -- pushErrorHandler(currentErrorHandler == _error and errHand or currentErrorHandler)
1078+ -- end
10791079 function popErrorHandler ()
10801080 table.remove (errorHandlers )
10811081 if not errorHandlers [1 ] then
@@ -1552,8 +1552,11 @@ local function _processFileOrString(params, isFile)
15521552 if isFile then
15531553 if not params .pathIn then error (" Missing 'pathIn' in params." , 2 ) end
15541554 if not params .pathOut then error (" Missing 'pathOut' in params." , 2 ) end
1555+
1556+ if params .pathOut == params .pathIn then error (" 'pathIn' and 'pathOut' are the same in params." , 2 ) end
1557+
15551558 else
1556- if not params .code then error (" Missing 'code' in params." , 2 ) end
1559+ if not params .code then error (" Missing 'code' in params." , 2 ) end
15571560 end
15581561
15591562 local luaUnprocessed , pathIn
@@ -2328,6 +2331,8 @@ local function processFileOrString(params, isFile)
23282331 if params .onError then params .onError (errorToReturn ) end
23292332
23302333 if levelFromOurError then _error (ERROR_REDIRECTION ) end
2334+
2335+ return err -- Not sure when this return matters. I have a feeling it's never. 2021-05-12
23312336 end
23322337
23332338 isDebug = params .debug
@@ -2353,7 +2358,8 @@ local function processFileOrString(params, isFile)
23532358
23542359 -- Unhandled error.
23552360 if not (returnValues or errorToReturn ) then
2356- pcall (errHand , (not xpcallOk and xpcallErr or " Unknown processing error." ))
2361+ errorToReturn = (not xpcallOk and xpcallErr or " Unknown processing error." )
2362+ pcall (errHand , errorToReturn )
23572363 end
23582364
23592365 -- Handled error.
0 commit comments