using System;

namespace NcProgramManager.Cnc.Models
{
    public sealed class CncError
    {
        public int Code { get; }
        public string Source { get; }
        public string Message { get; }
        public DateTime At { get; }

        public CncError(int code, string source, string message)
        {
            Code = code;
            Source = source ?? "";
            Message = message ?? "";
            At = DateTime.Now;
        }

        public override string ToString()
        {
            return "[" + Code + "] " + Source + ": " + Message;
        }
    }
}
