aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/errors.lua
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2023-11-06 20:57:00 -0800
committerSteven Arcangeli <stevearc@stevearc.com>2023-11-06 20:57:12 -0800
commitdcbe650bd4811cefe5a885fafb6309c7d592bda6 (patch)
tree6cf35a2f156d93ed0c59af735853ec26b932b4ee /lua/conform/errors.lua
parentd8ec7f8d0b230805ddd49f8d2f6a5d81bd5bb6fd (diff)
fix: catch jobstart errors (#183)
Diffstat (limited to 'lua/conform/errors.lua')
-rw-r--r--lua/conform/errors.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/lua/conform/errors.lua b/lua/conform/errors.lua
index 3a56b80..43e9a7b 100644
--- a/lua/conform/errors.lua
+++ b/lua/conform/errors.lua
@@ -11,14 +11,16 @@ M.ERROR_CODE = {
INVALID_ARGS = 1,
-- Command was not executable
NOT_EXECUTABLE = 2,
+ -- Error occurred during when calling jobstart
+ JOBSTART = 3,
-- Command timed out during execution
- TIMEOUT = 3,
+ TIMEOUT = 4,
-- Command was pre-empted by another call to format
- INTERRUPTED = 4,
+ INTERRUPTED = 5,
-- Command produced an error during execution
- RUNTIME = 5,
+ RUNTIME = 6,
-- Asynchronous formatter results were discarded due to a concurrent modification
- CONCURRENT_MODIFICATION = 6,
+ CONCURRENT_MODIFICATION = 7,
}
---@param code conform.ERROR_CODE
@@ -40,6 +42,7 @@ M.is_execution_error = function(code)
return code == M.ERROR_CODE.RUNTIME
or code == M.ERROR_CODE.NOT_EXECUTABLE
or code == M.ERROR_CODE.INVALID_ARGS
+ or code == M.ERROR_CODE.JOBSTART
end
---@param err1? conform.Error