diff options
author | Kurt Jung <kurt.w.jung@gmail.com> | 2015-08-17 07:18:26 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2015-08-17 07:18:26 -0400 |
commit | c2852e54f9dab4886e4679e7bb48513510444f02 (patch) | |
tree | b6cfa4b770aaf7a7dae4910997c01c9b24ac57e8 | |
parent | 5e7e0e576fcb62062a7a12023bf1babad96eecac (diff) |
Add method to clear current error
-rw-r--r-- | fpdf.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -224,6 +224,14 @@ func (f *Fpdf) Err() bool { return f.err != nil } +// ClearError unsets the internal Fpdf error. This method should be used with +// care, as an internal error condition usually indicates an unrecoverable +// problem with the generation of a document. It is intended to deal with cases +// in which an error is used to select an alternate form of the document. +func (f *Fpdf) ClearError() { + f.err = nil +} + // SetErrorf sets the internal Fpdf error with formatted text to halt PDF // generation; this may facilitate error handling by application. If an error // condition is already set, this call is ignored. @@ -2060,7 +2068,7 @@ func (f *Fpdf) write(h float64, txtStr string, link int, linkStr string) { l := 0.0 nl := 1 for i < nb { - // Get next character + // Get next character c := []byte(s)[i] if c == '\n' { // Explicit line break |