Example #1
0
// GetError Returns the nth error or warning encountered during parsing,
// consistency checking, or attempted translation of this model.
//
// Callers can use method XMLError_getSeverity() on the result to assess
// the severity of the problem.  The severity levels range from
// informationl messages to fatal errors.
//
// Returns the error or warning indexed by integer n, or return nil
// if n > (SBMLDocument_getNumErrors() - 1).
func (d *Document) GetError(n int) (err *Error) {
	err = new(Error)
	err.e = C.SBMLDocument_getError(d.d, C.uint(n))
	if err.e == nil {
		return nil
	}

	err.ErrorId = int(C.XMLError_getErrorId(err.e))
	err.Level = int(C.SBMLDocument_getDefaultLevel())
	err.Version = int(C.SBMLDocument_getDefaultVersion())
	// Details string
	err.Line = int(C.XMLError_getLine(err.e))
	err.Column = int(C.XMLError_getColumn(err.e))
	err.Severity = int(C.XMLError_getSeverity(err.e))
	err.Category = int(C.XMLError_getCategory(err.e))
	err.Message = C.GoString(C.XMLError_getMessage(err.e))

	return err
}
Example #2
0
//GetDefaultVersion ...
func (d *Document) GetDefaultVersion() int {
	return int(C.SBMLDocument_getDefaultVersion())
}