Fixed all REST endpoints to use RestObjects instead of Dictionaries.

This commit is contained in:
CoderCow 2013-08-02 10:20:11 +02:00
parent 11f3099d30
commit 9a40c81b49
3 changed files with 18 additions and 39 deletions

View file

@ -174,17 +174,15 @@ namespace Rests
}
catch (Exception exception)
{
return new Dictionary<string, string>
return new RestObject("500")
{
{"status", "500"},
{"error", "Internal server error."},
{"errormsg", exception.Message},
{"stacktrace", exception.StackTrace},
};
}
return new Dictionary<string, string>
return new RestObject("404")
{
{"status", "404"},
{"error", "Specified API endpoint doesn't exist. Refer to the documentation for a list of valid endpoints."}
};
}