note 111005 added to function.mqseries-strerror

From: Date: Fri, 04 Jan 2013 15:03:56 +0000
Subject: note 111005 added to function.mqseries-strerror
Groups: php.notes 
Request: Send a blank email to php-notes+get-192764@lists.php.net to get a copy of this message
There might be some error codes missing from the package depending on the MQ client version you are using. To prevent further versions from returning an empty error message simply use a function such as: <?php //... wrapper class ... public function getErrorMessage ($errorCode) { $errorString = mqseries_strerror($errorCode); if (!empty($errorString)) { return $errorString; } else { switch ($errorCode) { // insert missing codes here case 2537: return "Channel is not available."; case 2538: return "Host is not available."; case 2539: return "Channel configuration error."; case 2540: return "Channel name is unknown."; default: return "Unexpected error ({$errorCode})"; } } } // ... wrapper class ... ?> ---- Server IP: 64.71.164.2 Probable Submitter: 69.26.213.2 ---- Manual Page -- http://php.net/manual/en/function.mqseries-strerror.php Edit -- https://master.php.net/note/edit/111005 Del: integrated -- https://master.php.net/note/delete/111005/integrated Del: useless -- https://master.php.net/note/delete/111005/useless Del: bad code -- https://master.php.net/note/delete/111005/bad+code Del: spam -- https://master.php.net/note/delete/111005/spam Del: non-english -- https://master.php.net/note/delete/111005/non-english Del: in docs -- https://master.php.net/note/delete/111005/in+docs Del: other reasons-- https://master.php.net/note/delete/111005 Reject -- https://master.php.net/note/reject/111005 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#192764) next »