export class RouteError {
  constructor(code, message) {
    this.code = code;
    this.message = message;
  }

  static tryFrom(object) {
    if (typeof object.code === 'number' && typeof object.message === 'string') return new RouteError(object.code, object.message);
    else return null;
  }
}
