forked from gordon-matt/elFinder.NetCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathError.cs
More file actions
37 lines (31 loc) · 950 Bytes
/
Copy pathError.cs
File metadata and controls
37 lines (31 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Microsoft.AspNetCore.Mvc;
namespace elFinder.NetCore.Helpers
{
internal static class Error
{
public static JsonResult AccessDenied()
{
return FormatSimpleError("errAccess");
}
public static JsonResult CannotUploadFile()
{
return FormatSimpleError("errUploadFile");
}
public static JsonResult CommandNotFound()
{
return FormatSimpleError("errUnknownCmd");
}
public static JsonResult MaxUploadFileSize()
{
return FormatSimpleError("errFileMaxSize");
}
public static JsonResult MissedParameter(string command)
{
return new JsonResult(new { error = new string[] { "errCmdParams", command } });
}
private static JsonResult FormatSimpleError(string message)
{
return new JsonResult(new { error = message });
}
}
}