{"action":"created","issue":{"url":"https://api.github.com/repos/square/retrofit/issues/2773","repository_url":"https://api.github.com/repos/square/retrofit","labels_url":"https://api.github.com/repos/square/retrofit/issues/2773/labels{/name}","comments_url":"https://api.github.com/repos/square/retrofit/issues/2773/comments","events_url":"https://api.github.com/repos/square/retrofit/issues/2773/events","html_url":"https://github.com/square/retrofit/issues/2773","id":328284534,"node_id":"MDU6SXNzdWUzMjgyODQ1MzQ=","number":2773,"title":"Feature Request: \"IllegalArgumentException: Path parameter XXX value must not be null.\" should include url","user":{"login":"tir38","id":1980553,"node_id":"MDQ6VXNlcjE5ODA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1980553?v=4","gravatar_id":"","url":"https://api.github.com/users/tir38","html_url":"https://github.com/tir38","followers_url":"https://api.github.com/users/tir38/followers","following_url":"https://api.github.com/users/tir38/following{/other_user}","gists_url":"https://api.github.com/users/tir38/gists{/gist_id}","starred_url":"https://api.github.com/users/tir38/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tir38/subscriptions","organizations_url":"https://api.github.com/users/tir38/orgs","repos_url":"https://api.github.com/users/tir38/repos","events_url":"https://api.github.com/users/tir38/events{/privacy}","received_events_url":"https://api.github.com/users/tir38/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T20:25:53Z","updated_at":"2018-05-31T20:26:56Z","closed_at":null,"author_association":"NONE","body":"I was not properly setting a `Path` parameter and saw:\r\n\r\n`Caused by: java.lang.IllegalArgumentException: Path parameter \"user_id\" value must not be null.`\r\n\r\nThe problem is that I have ~20 web requests all with the `user_id` path parameter. I have no easy way to diagnose which one I'm calling incorrectly. It would be great if that error message included the url.\r\n\r\nI think it should be pretty easy to update `Path` to:\r\n\r\n```\r\nstatic final class Path<T> extends ParameterHandler<T> {\r\n    @Override\r\n    void apply(RequestBuilder builder, @Nullable T value) throws IOException {\r\n        if (value == null) {\r\n            throw new IllegalArgumentException(\r\n                    \"Path parameter \\\"\" + name + \"\\\" value must not be null in request \"\r\n                            + builder.baseUrl + builder.relativeUrl);\r\n        }\r\n        builder.addPathParam(name, valueConverter.convert(value), encoded);\r\n    }\r\n}\r\n```\r\n\r\nProbably worth updating all `ParameterHandler`s that throw when value is null.\r\n\r\n\r\nFor the record, calling a service method inside RxJava stream results in a stack trace that isn't very helpful:\r\n\r\n```\r\n   io.reactivex.exceptions.OnErrorNotImplementedException: Path parameter \"user_id\" value must not be null.\r\n        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)\r\n        at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)\r\n        at io.reactivex.internal.observers.ConsumerSingleObserver.onError(ConsumerSingleObserver.java:47)\r\n        at io.reactivex.internal.operators.single.SingleObserveOn$ObserveOnSingleObserver.run(SingleObserveOn.java:79)\r\n        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)\r\n        at android.os.Handler.handleCallback(Handler.java:751)\r\n        at android.os.Handler.dispatchMessage(Handler.java:95)\r\n        at android.os.Looper.loop(Looper.java:154)\r\n        at android.app.ActivityThread.main(ActivityThread.java:6121)\r\n        at java.lang.reflect.Method.invoke(Native Method)\r\n        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)\r\n        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)\r\n     Caused by: java.lang.IllegalArgumentException: Path parameter \"user_id\" value must not be null.\r\n        at retrofit2.ParameterHandler$Path.apply(ParameterHandler.java:96)\r\n        at retrofit2.ServiceMethod.toRequest(ServiceMethod.java:111)\r\n        at retrofit2.OkHttpCall.createRawCall(OkHttpCall.java:184)\r\n        at retrofit2.OkHttpCall.execute(OkHttpCall.java:168)\r\n        at retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:41)\r\n        at io.reactivex.Observable.subscribe(Observable.java:12025)\r\n        at io.reactivex.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)\r\n        at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:571)\r\n        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)\r\n        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)\r\n        at java.util.concurrent.FutureTask.run(FutureTask.java:237)\r\n        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)\r\n        at java.lang.Thread.run(Thread.java:761)\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/square/retrofit/issues/comments/393668635","html_url":"https://github.com/square/retrofit/issues/2773#issuecomment-393668635","issue_url":"https://api.github.com/repos/square/retrofit/issues/2773","id":393668635,"node_id":"MDEyOklzc3VlQ29tbWVudDM5MzY2ODYzNQ==","user":{"login":"tir38","id":1980553,"node_id":"MDQ6VXNlcjE5ODA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1980553?v=4","gravatar_id":"","url":"https://api.github.com/users/tir38","html_url":"https://github.com/tir38","followers_url":"https://api.github.com/users/tir38/followers","following_url":"https://api.github.com/users/tir38/following{/other_user}","gists_url":"https://api.github.com/users/tir38/gists{/gist_id}","starred_url":"https://api.github.com/users/tir38/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tir38/subscriptions","organizations_url":"https://api.github.com/users/tir38/orgs","repos_url":"https://api.github.com/users/tir38/repos","events_url":"https://api.github.com/users/tir38/events{/privacy}","received_events_url":"https://api.github.com/users/tir38/received_events","type":"User","site_admin":false},"created_at":"2018-05-31T20:26:56Z","updated_at":"2018-05-31T20:26:56Z","author_association":"NONE","body":"I'd be willing to work on this if I get a 👍 "}}
{"actor":{"display_login":"tir38"}}