public String getContext() { return _source.getContext(); }
public YamlSyntaxErrorException(String message, MarkedYAMLException cause) { super(cause.getContext(), cause.getContextMark(), message, cause.getProblemMark()); }
public String getContext() { return _source.getContext(); }
public ParsingError(ErrorCode errorCode, MarkedYAMLException cause) { this(ParsingErrorLevel.ERROR, errorCode, cause.getContext(), cause.getContextMark() != null ? cause.getContextMark() : cause.getProblemMark(), cause.getProblem(), cause.getProblemMark(), null); } }
public String getContext() { return _source.getContext(); }
public String getContext() { return _source.getContext(); }
public YAMLParserException interpret(ConstructorException e) { String context = ""; if (e.getCause() instanceof MarkedYAMLException) { context = ((MarkedYAMLException) e.getCause()).getContext(); } else { return new InvalidYamlSyntax(e.toString()); } String messagePattern = "The property= '{}' could not be interpreted by the SnakeYAML parser\n{}"; String invalidDescription = "Cannot create property=description.*"; if (context.matches(invalidDescription)) { return new InvalidYamlSyntax(messagePattern, "description", e); } String invalidType = "Cannot create property=metadata.*"; if (context.matches(invalidType)) { return new InvalidYamlSyntax(messagePattern, "metadata", e); } return new InvalidYamlSyntax(e.toString()); }
private static void raiseParserException(ThreadContext context, IRubyObject yaml, MarkedYAMLException mye, IRubyObject rbPath) { Ruby runtime; Mark mark; RubyClass se; IRubyObject exception; runtime = context.runtime; se = (RubyClass)runtime.getModule("Psych").getConstant("SyntaxError"); mark = mye.getProblemMark(); exception = se.newInstance(context, new IRubyObject[] { rbPath, runtime.newFixnum(mark.getLine() + 1), runtime.newFixnum(mark.getColumn() + 1), runtime.newFixnum(mark.getIndex()), (null == mye.getProblem() ? runtime.getNil() : runtime.newString(mye.getProblem())), (null == mye.getContext() ? runtime.getNil() : runtime.newString(mye.getContext())) }, Block.NULL_BLOCK); RubyKernel.raise(context, runtime.getKernel(), new IRubyObject[] { exception }, Block.NULL_BLOCK); }
private static void raiseParserException(ThreadContext context, IRubyObject yaml, MarkedYAMLException mye, IRubyObject rbPath) { Ruby runtime; Mark mark; RubyClass se; IRubyObject exception; runtime = context.runtime; se = (RubyClass)runtime.getModule("Psych").getConstant("SyntaxError"); mark = mye.getProblemMark(); exception = se.newInstance(context, new IRubyObject[] { rbPath, runtime.newFixnum(mark.getLine() + 1), runtime.newFixnum(mark.getColumn() + 1), runtime.newFixnum(mark.getIndex()), (null == mye.getProblem() ? runtime.getNil() : runtime.newString(mye.getProblem())), (null == mye.getContext() ? runtime.getNil() : runtime.newString(mye.getContext())) }, Block.NULL_BLOCK); RubyKernel.raise(context, runtime.getKernel(), new IRubyObject[] { exception }, Block.NULL_BLOCK); }