Skip to content

Commit a4e87cb

Browse files
committed
Revert throwPluginError to throwE
This reverts a change made previously to try to make pluginErrors have a common error format. This will be updated in the near future.
1 parent c857168 commit a4e87cb

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

hls-plugin-api/src/Ide/PluginUtils.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,8 @@ getNormalizedFilePath (PluginId plId) uri = handleMaybe errMsg
253253
errMsg = T.unpack $ "Error(" <> plId <> "): converting " <> getUri uri <> " to NormalizedFilePath"
254254

255255
-- ---------------------------------------------------------------------
256-
throwPluginError :: Monad m => PluginId -> String -> String -> ExceptT String m b
257-
throwPluginError (PluginId who) what where' = throwE msg
258-
where
259-
msg = (T.unpack who) <> " failed with " <> what <> " at " <> where'
256+
throwPluginError :: Monad m => String -> ExceptT String m b
257+
throwPluginError = throwE
260258

261259
handleMaybe :: Monad m => e -> Maybe b -> ExceptT e m b
262260
handleMaybe msg = maybe (throwE msg) return

plugins/hls-call-hierarchy-plugin/src/Ide/Plugin/CallHierarchy/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ incomingCalls state pluginId param = pluginResponse $ do
203203
mergeIncomingCalls
204204
case calls of
205205
Just x -> pure $ Just $ List x
206-
Nothing -> throwPluginError callHierarchyId "Internal Error" "incomingCalls"
206+
Nothing -> throwPluginError "incomingCalls - Internal Error"
207207
where
208208
mkCallHierarchyIncomingCall :: Vertex -> Action (Maybe CallHierarchyIncomingCall)
209209
mkCallHierarchyIncomingCall = mkCallHierarchyCall CallHierarchyIncomingCall
@@ -224,7 +224,7 @@ outgoingCalls state pluginId param = pluginResponse $ do
224224
mergeOutgoingCalls
225225
case calls of
226226
Just x -> pure $ Just $ List x
227-
Nothing -> throwPluginError callHierarchyId "Internal Error" "outgoingCalls"
227+
Nothing -> throwPluginError "outgoingCalls - Internal Error"
228228
where
229229
mkCallHierarchyOutgoingCall :: Vertex -> Action (Maybe CallHierarchyOutgoingCall)
230230
mkCallHierarchyOutgoingCall = mkCallHierarchyCall CallHierarchyOutgoingCall

0 commit comments

Comments
 (0)