Project

General

Profile

Actions

Bug #434

closed

xmlparse.inc should not call die

Added by znerol znerol over 14 years ago. Updated over 14 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
03/17/2010
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
All
Affected Architecture:

Description

In pfsense-mainline:

$ git grep '\bdie\b' etc/inc/xmlparse.inc
etc/inc/xmlparse.inc:           die(sprintf("XML error: %s at line %d cannot occ
etc/inc/xmlparse.inc:           die("Error: could not open XML input\n");
etc/inc/xmlparse.inc:           die("XML error: no $rootobj object found!\n");

Client code should have a chance to handle valid XML files which simply happen to lack some required tags ($rootobj). In my opinion it would be better to return false or an error instead of killing the whole script - at least when a recoverable error occures (like in the last case).

See #431 attachement console-log-after.txt for an example where this behaviour is harmful.

Actions

Also available in: Atom PDF