{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc/issues/7234","repository_url":"https://api.github.com/repos/grpc/grpc","labels_url":"https://api.github.com/repos/grpc/grpc/issues/7234/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/7234/comments","events_url":"https://api.github.com/repos/grpc/grpc/issues/7234/events","html_url":"https://github.com/grpc/grpc/issues/7234","id":163966424,"number":7234,"title":"C# RpcException is missing a recommended constructor overload setting InnerException","user":{"login":"kkm000","id":8228229,"avatar_url":"https://avatars.githubusercontent.com/u/8228229?v=3","gravatar_id":"","url":"https://api.github.com/users/kkm000","html_url":"https://github.com/kkm000","followers_url":"https://api.github.com/users/kkm000/followers","following_url":"https://api.github.com/users/kkm000/following{/other_user}","gists_url":"https://api.github.com/users/kkm000/gists{/gist_id}","starred_url":"https://api.github.com/users/kkm000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkm000/subscriptions","organizations_url":"https://api.github.com/users/kkm000/orgs","repos_url":"https://api.github.com/users/kkm000/repos","events_url":"https://api.github.com/users/kkm000/events{/privacy}","received_events_url":"https://api.github.com/users/kkm000/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/grpc/grpc/labels/api%20feedback","name":"api feedback","color":"5319e7"},{"url":"https://api.github.com/repos/grpc/grpc/labels/C%23","name":"C#","color":"207de5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-05T23:10:22Z","updated_at":"2016-09-07T17:23:15Z","closed_at":null,"body":"All publicly consrtructible BCL exceptions provide a constructor overload that sets the `InnerException` property (through a base constructor invocation). `RpcException` must be augmented with such an overload:\r\n\r\n```c#\r\n  public RpcException(Status status, string message, Exception innerException) : base(message, innerException) { ... }\r\n```\r\n\r\nThe recommendations is mentioned, albeit non-literally, in [Best Practices for Exceptions](https://msdn.microsoft.com/en-us/library/seyhszts(v=vs.110).aspx) and [How to: Create User-Defined Exceptions](https://msdn.microsoft.com/en-us/library/87cdya3t(v=vs.110).aspx). In practice, it really helps to construct a different exception when converging multiple possible errors that have the same semantics, and it is very important not to lose the backtrace information in such a case."},"comment":{"url":"https://api.github.com/repos/grpc/grpc/issues/comments/245354696","html_url":"https://github.com/grpc/grpc/issues/7234#issuecomment-245354696","issue_url":"https://api.github.com/repos/grpc/grpc/issues/7234","id":245354696,"user":{"login":"jtattermusch","id":9939684,"avatar_url":"https://avatars.githubusercontent.com/u/9939684?v=3","gravatar_id":"","url":"https://api.github.com/users/jtattermusch","html_url":"https://github.com/jtattermusch","followers_url":"https://api.github.com/users/jtattermusch/followers","following_url":"https://api.github.com/users/jtattermusch/following{/other_user}","gists_url":"https://api.github.com/users/jtattermusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jtattermusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtattermusch/subscriptions","organizations_url":"https://api.github.com/users/jtattermusch/orgs","repos_url":"https://api.github.com/users/jtattermusch/repos","events_url":"https://api.github.com/users/jtattermusch/events{/privacy}","received_events_url":"https://api.github.com/users/jtattermusch/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T17:23:15Z","updated_at":"2016-09-07T17:23:15Z","body":"Is there some practical use case where exposing this overload would matter? The thing with RpcException is that it is only thrown by gRPC as a result of a remote call, in which case the Status and message are exactly what you need as there is no exception information transferred from the remote side besides  status, message and optionally the trailing metadata.\r\n\r\nI can only imagine that you could use the InnerException if something went wrong in gRPC implementation itself - but I am not sure if the user should care. Also, the RpcException can only be constructed if the status code is obtained successfully (and C core guarantees that obtaining it will always succeed), so I am not quite sure where the inner exception would come from."}}
{"actor":{"display_login":"jtattermusch"}}