-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrors.cs
31 lines (30 loc) · 1.13 KB
/
Errors.cs
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
using System.Collections.Generic;
namespace interspace{
public class Errors{
public enum ErrorCode{
// this class contains codes of various events that could ruin user interaction with program
NO_ERROR,
ARGUMENT_ERROR,
FILE_GENERAL_ERROR,
FILE_LOADING_ERROR,
MATRIX_NULL_ERROR,
MATRIX_SIZE_ERROR,
MATRIX_FORMAT_ERROR,
MATRIX_INDEX_ERROR,
UNKNOWN_COMMAND_ERROR,
UNSPECIFIED_ERROR
}
public static Dictionary<ErrorCode, string> errorCommunicates = new Dictionary<ErrorCode, string>(){
//sent to console during error
{ErrorCode.NO_ERROR, "OK"},
{ErrorCode.ARGUMENT_ERROR, "Wrong arguments"},
{ErrorCode.FILE_GENERAL_ERROR, "There was a problem with loading file"},
{ErrorCode.FILE_LOADING_ERROR, "The file does not exist"},
{ErrorCode.MATRIX_NULL_ERROR, "The matrix is not initialized"},
{ErrorCode.MATRIX_SIZE_ERROR, "The matrix size must be positive"},
{ErrorCode.MATRIX_FORMAT_ERROR, "The matrix provided in input has wrong format"},
{ErrorCode.MATRIX_INDEX_ERROR, "The index was outside of the bounds of matrix"},
{ErrorCode.UNKNOWN_COMMAND_ERROR, "Unknown command"},
};
}
}