Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions Refit/RestMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public RestMethodInfo(Type targetInterface, MethodInfo methodInfo, RefitSettings

var ctParams = methodInfo.GetParameters().Where(p => p.ParameterType == typeof(CancellationToken)).ToList();
if(ctParams.Count > 1) {
throw new ArgumentException("Argument list can only contain a single CancellationToken");
throw new ArgumentException($"Argument list to method \"{methodInfo.Name}\" can only contain a single CancellationToken");
}

CancellationToken = ctParams.FirstOrDefault();
Expand All @@ -117,7 +117,7 @@ void VerifyUrlPathIsSane(string relativePath)
return;

bogusPath:
throw new ArgumentException("URL path must be of the form '/foo/bar/baz'");
throw new ArgumentException($"URL path {relativePath} must be of the form '/foo/bar/baz'");
}

Dictionary<int, string> BuildParameterMap(string relativePath, List<ParameterInfo> parameterInfo)
Expand All @@ -137,7 +137,7 @@ Dictionary<int, string> BuildParameterMap(string relativePath, List<ParameterInf
foreach (var match in parameterizedParts) {
var name = match.Groups[1].Value.ToLowerInvariant();
if (!paramValidationDict.ContainsKey(name)) {
throw new ArgumentException(string.Format("URL has parameter {0}, but no method parameter matches", name));
throw new ArgumentException($"URL {relativePath} has parameter {name}, but no method parameter matches");
}

ret.Add(parameterInfo.IndexOf(paramValidationDict[name]), name);
Expand Down Expand Up @@ -290,7 +290,7 @@ void DetermineReturnTypeInfo(MethodInfo methodInfo)
return;

bogusMethod:
throw new ArgumentException("All REST Methods must return either Task<T> or IObservable<T>");
throw new ArgumentException($"Method \"{methodInfo.Name}\" is invalid. All REST Methods must return either Task<T> or IObservable<T>");
}
}
}