public static function createUsingFormat($format)
    {
        $previous = null;

        if (1 < func_num_args()) {
            $args = array_slice(func_get_args(), 1);

            // extract $previous exception
            if (end($args) instanceof \Exception) {
                $previous = array_pop($args);
            }

            if ($args) {
                $format = vsprintf($format, $args);
            }
        }

        return new static($format, 0, $previous);
    }