@@ -140,7 +140,7 @@ public function addLink($linkSrc, $linkName = null, $style = null)
140
140
$ this ->_elementCollection [] = $ link ;
141
141
return $ link ;
142
142
} else {
143
- trigger_error ('Unsupported Link header / footer reference ' );
143
+ throw new Exception ('Unsupported Link header / footer reference ' );
144
144
return false ;
145
145
}
146
146
}
@@ -198,7 +198,7 @@ public function addImage($src, $style = null)
198
198
$ this ->_elementCollection [] = $ image ;
199
199
return $ image ;
200
200
} else {
201
- trigger_error ('Source does not exist or unsupported image type. ' );
201
+ throw new Exception ('Source does not exist or unsupported image type. ' );
202
202
}
203
203
}
204
204
@@ -225,7 +225,7 @@ public function addMemoryImage($link, $style = null)
225
225
$ this ->_elementCollection [] = $ memoryImage ;
226
226
return $ memoryImage ;
227
227
} else {
228
- trigger_error ('Unsupported image type. ' );
228
+ throw new Exception ('Unsupported image type. ' );
229
229
}
230
230
}
231
231
@@ -266,7 +266,7 @@ public function addObject($src, $style = null)
266
266
$ this ->_elementCollection [] = $ object ;
267
267
return $ object ;
268
268
} else {
269
- trigger_error ('Source does not exist or unsupported object type. ' );
269
+ throw new Exception ('Source does not exist or unsupported object type. ' );
270
270
}
271
271
}
272
272
@@ -288,7 +288,7 @@ public function addPreserveText($text, $styleFont = null, $styleParagraph = null
288
288
$ this ->_elementCollection [] = $ ptext ;
289
289
return $ ptext ;
290
290
} else {
291
- trigger_error ('addPreserveText only supported in footer/header. ' );
291
+ throw new Exception ('addPreserveText only supported in footer/header. ' );
292
292
}
293
293
}
294
294
0 commit comments