summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-08-17 07:18:26 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-08-17 07:18:26 -0400
commitc2852e54f9dab4886e4679e7bb48513510444f02 (patch)
treeb6cfa4b770aaf7a7dae4910997c01c9b24ac57e8
parent5e7e0e576fcb62062a7a12023bf1babad96eecac (diff)
Add method to clear current error
-rw-r--r--fpdf.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/fpdf.go b/fpdf.go
index dfd721f..c7042c7 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -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