public static function setError($code, $message = '')
    {
        if (!isset(self::$errorCodes[$code])) {
            throw new \InvalidArgumentException(sprintf('No such error code: "%s"', $code));
        }

        self::$errorMessage = $message ? sprintf('%s: %s', $message, self::$errorCodes[$code]) : self::$errorCodes[$code];
        self::$errorCode = $code;
    }
public static function setError($code, $message = '')
    {
        if (!isset(self::$errorCodes[$code])) {
            throw new \InvalidArgumentException(sprintf('No such error code: "%s"', $code));
        }

        self::$errorMessage = $message ? sprintf('%s: %s', $message, self::$errorCodes[$code]) : self::$errorCodes[$code];
        self::$errorCode = $code;
    }
public static function setError ( $ code , $ message = '' ) { if ( ! isset ( self :: $ errorCodes [ $ code ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'No such error code: "%s"' , $ code ) ) ; } self :: $ errorMessage = $ message ? sprintf ( '%s: %s' , $ message , self :: $ errorCodes [ $ code ] ) : self :: $ errorCodes [ $ code ] ; self :: $ errorCode = $ code ; }
Sets the current error.

@param int    $code    One of the error constants in this class
@param string $message The ICU class error message

@throws \InvalidArgumentException If the code is not one of the error constants in this class
Sets the current error .