import {ParamEvent as ParamEvent2} from "../../../poly/ParamEvent";
export class ErrorState {
  constructor(param) {
    this.param = param;
  }
  set(message) {
    if (this._message != message) {
      this._message = message;
      if (this._message) {
        console.warn(this.param.fullPath(), this._message);
      }
      this.param.emitController.emit(ParamEvent2.ERROR_UPDATED);
    }
  }
  message() {
    return this._message;
  }
  clear() {
    this.set(void 0);
  }
  active() {
    return this._message != null;
  }
}
