mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-22 07:14:21 +00:00
Fix JSON error responses
This commit is contained in:
1 parent
bad8efca47
commit
18df3bafb5
5 files changed
+13
-13
No files matched your search
@@ -85,14 +85,14 @@
|
||||
{
|
||||
errorFormat = [self labelForKey: @"The folder with name \"%@\" could not be created." inContext: context];
|
||||
jsonResponse = [NSDictionary dictionaryWithObject: [NSString stringWithFormat: errorFormat, folderName]
|
||||
forKey: @"error"];
|
||||
forKey: @"message"];
|
||||
response = [self responseWithStatus: 500 andJSONRepresentation: jsonResponse];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Missing 'name' parameter." inContext: context]
|
||||
forKey: @"error"];
|
||||
forKey: @"message"];
|
||||
response = [self responseWithStatus: 500 andJSONRepresentation: jsonResponse];
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
if (error)
|
||||
{
|
||||
jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to move/delete folder." inContext: context]
|
||||
forKey: @"error"];
|
||||
forKey: @"message"];
|
||||
response = [self responseWithStatus: 500 andJSONRepresentation: jsonResponse];
|
||||
}
|
||||
else
|
||||
@@ -428,7 +428,7 @@
|
||||
if (error)
|
||||
{
|
||||
jsonResponse = [NSDictionary dictionaryWithObject: [self labelForKey: @"Unable to move/delete folder." inContext: context]
|
||||
forKey: @"error"];
|
||||
forKey: @"message"];
|
||||
response = [self responseWithStatus: 500 andJSONRepresentation: jsonResponse];
|
||||
}
|
||||
else
|
||||
@@ -993,7 +993,7 @@
|
||||
{
|
||||
result = [NSDictionary dictionaryWithObject: [self labelForKey: @"Missing 'flags' and 'msgUIDs' parameters."
|
||||
inContext: context]
|
||||
forKey: @"error"];
|
||||
forKey: @"message"];
|
||||
response = [self responseWithStatus: 500 andJSONRepresentation: result];
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user