All API requests now respond with a predictable template, for further troubleshooting.

This commit is contained in:
Lucas Nicodemus 2011-09-05 01:37:56 -06:00
parent e4030d9e38
commit 1fa5c7236e
2 changed files with 6 additions and 6 deletions

View file

@ -98,9 +98,9 @@ namespace TShockAPI
var obj = ExecuteCommand(com, verbs, e.Request.Parameters);
if (obj != null)
return obj;
}
return new Dictionary<string, string> { { "Error", "Invalid request" } };
return new Dictionary<string, string> { { "status", "404" }, {"error", "Specified API endpoint doesn't exist. Refer to the documentation for a list of valid endpoints."} };
}
protected virtual object ExecuteCommand(RestCommand cmd, RestVerbs verbs, IParameterCollection parms)