|
static bool | WriteJson (string path, Func< JsonObject > createJson, bool pretty=false, Action failCallback=null, Action< string, Exception > overrideExceptionHandling=null) |
|
Definition at line 9 of file FileWriter.cs.
◆ HandleException()
static void BGC.IO.FileWriter.HandleException |
( |
string |
path, |
|
|
Exception |
excp |
|
) |
| |
|
inlinestaticprivate |
Definition at line 44 of file FileWriter.cs.
46 string[] errorMessage;
50 errorMessage =
new string[]
52 "JSON serialization error.",
59 errorMessage =
new string[]
61 "Exception Encountered",
static void HandleExceptionFile(string path, string[] errorMessage)
The exception that is thrown when a JSON value cannot be serialized.
◆ HandleExceptionFile()
static void BGC.IO.FileWriter.HandleExceptionFile |
( |
string |
path, |
|
|
string [] |
errorMessage |
|
) |
| |
|
inlinestaticprivate |
Definition at line 70 of file FileWriter.cs.
72 string fileName = Path.GetFileName(path);
74 string directoryPath = Path.GetDirectoryName(path);
75 string directoryName = Path.GetFileName(directoryPath);
76 string errorDirectory = $
"Error{directoryName}";
77 string errorDirectoryPath = Path.Combine(Path.GetDirectoryName(directoryPath), errorDirectory);
78 string errorLogPath = Path.Combine(errorDirectoryPath, $
"{fileName}_error.txt");
80 if (!Directory.Exists(errorDirectoryPath))
82 Directory.CreateDirectory(errorDirectoryPath);
85 if (File.Exists(errorLogPath))
87 File.Delete(errorLogPath);
90 File.WriteAllLines(errorLogPath, errorMessage);
◆ WriteJson()
static bool BGC.IO.FileWriter.WriteJson |
( |
string |
path, |
|
|
Func< JsonObject > |
createJson, |
|
|
bool |
pretty = false , |
|
|
Action |
failCallback = null , |
|
|
Action< string, Exception > |
overrideExceptionHandling = null |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following file: