question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should we model compilation errors as JSON-RPC errors?

See original GitHub issue

@jvican how compile errors in a CompileResult should be communicated.

In the current implementation, a CompileResult contains no specific information as to compile errors, but by being a successful result it signals that the overall compilation succeded. In the case of any error, a JsonRpc error result is returned. Individual per-target CompileReport notifications communicate the results during compilation.

The argument for this mechanic is that a client can assume a successful result allows to resume normally with dependent tasks.

The argument against is that compile errors are a part of normal operation of the compiler, and only internal errors should trigger exception handling.

To be discussed for bsp 2.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
olafurpgcommented, Jun 15, 2018

I recommend using JSON-RPC errors only for 1) error handling at the JSON-RPC layer and 2) internal server error. Application-level errors like “compilation failed” should be encoded in the protocol messages.

1reaction
jvicancommented, Jun 15, 2018

“error: code and message set in case an exception happens during the request.”

Yeah, which are JSON-RPC errors.

I also think that we should perhaps move valid errors like compilation failed to the BSP layer instead of JSON-RPC in BSP 2.0. That will be conceptually simpler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Standard RPC Errors Should I Handle?
Is there documentation that lists ALL the types of web3 exceptions that can be thrown by an RPC endpoint? eg. gas price too...
Read more >
8 Tips for Solving The JSON RPC Error In Metamask
In this article, we are sharing 5 best practices and 8 possible solutions that can help you solve the internal JSON 32603. Before...
Read more >
JSON-RPC 2.0 Specification
1 Overview. JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol. Primarily this specification defines several data structures and the ...
Read more >
JSONRPC format different between Jsonrpc4j and go's rpc ...
The problem is jsonrpc4j is when error happen, golang`s method will return error and encoding to json. I got this json object in...
Read more >
NPM packages for vscode-jsonrpc and vscode ... - GitHub
Compile using tsc -p . Produces no errors for me. @felixfbecker can you please provide a setup in which this result in compile...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found