Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Log response on exception #123

Merged
merged 2 commits into from
Aug 12, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/scry/analyzer.cr
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module Scry
end
end
rescue ex
Log.logger.error("A error was found while searching diagnostics\n#{ex}")
Log.logger.error("A error was found while searching diagnostics\n#{ex}\n#{response}")
nil
end

Expand Down
2 changes: 1 addition & 1 deletion src/scry/formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Scry
ResponseMessage.new(@text_document.id, [TextEdit.new(range, result)])
end
rescue ex
Log.logger.error("A error was found while formatting\n#{ex}")
Log.logger.error("A error was found while formatting\n#{ex}\n#{result}")
nil
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/scry/hover_provider.cr
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ module Scry
end

private def analyze(filename, position, scope)
response = crystal_tool(filename, position, scope)
response = (Array(BuildFailure) | HoverResponse).from_json(response)
result = crystal_tool(filename, position, scope)
response = (Array(BuildFailure) | HoverResponse).from_json(result)
case response
when Array(BuildFailure)
hover_response
Expand All @@ -53,7 +53,7 @@ module Scry
end
end
rescue ex
Log.logger.error("A error was found while searching contexts\n#{ex}")
Log.logger.error("A error was found while searching contexts\n#{ex}\n#{result}")
hover_response
end

Expand Down
8 changes: 4 additions & 4 deletions src/scry/implementations.cr
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ module Scry
end

private def analyze(filename, position, scope)
response = crystal_tool(filename, position, scope)
Log.logger.debug("response: #{response}")
response = (Array(BuildFailure) | ImplementationsResponse).from_json(response)
result = crystal_tool(filename, position, scope)
Log.logger.debug("result: #{result}")
response = (Array(BuildFailure) | ImplementationsResponse).from_json(result)
case response
when Array(BuildFailure)
implementation_response
Expand All @@ -62,7 +62,7 @@ module Scry
end
end
rescue ex
Log.logger.error("A error was found while searching implementations\n#{ex}")
Log.logger.error("A error was found while searching implementations\n#{ex}\n#{result}")
implementation_response
end

Expand Down