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
42 lines (35 loc) · 1.11 KB
/
Copy pathError.cs
File metadata and controls
42 lines (35 loc) · 1.11 KB
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
38
39
40
41
42
using Microsoft.AspNetCore.Mvc;
namespace elFinder.NetCore.Helpers
{
public 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 } });
}
public static JsonResult NewNameSelectionException(string name)
{
return new JsonResult(new { error = $"Unable to create new file with name {name}" });
}
private static JsonResult FormatSimpleError(string message)
{
return new JsonResult(new { error = message });
}
}
}