diff --git a/po/pt_BR.po b/po/pt_BR.po index a071560..fa3afd4 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-15 15:09-0300\n" +"POT-Creation-Date: 2014-04-15 15:34-0300\n" "PO-Revision-Date: 2014-02-17 08:05-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Portugues <>\n" diff --git a/src/php/init.cc b/src/php/init.cc index a00c7a8..03f92af 100644 --- a/src/php/init.cc +++ b/src/php/init.cc @@ -32,6 +32,7 @@ */ #include "php3270.h" + #include /*--[ Implement ]--------------------------------------------------------------------------------------------------*/ @@ -51,25 +52,34 @@ PHP_METHOD(tn3270, __construct) trace("szName=%d",szName); - if(szName) + try { - char text[szName+1]; - strncpy(text,name,szName); - text[szName] = 0; - trace("session_name=\"%s\"",text); - obj->hSession = session::start(text); - } - else - { - obj->hSession = session::start(); - } - if(szURL) + if(szName) + { + char text[szName+1]; + strncpy(text,name,szName); + text[szName] = 0; + trace("session_name=\"%s\"",text); + obj->hSession = session::start(text); + } + else + { + obj->hSession = session::start(); + } + + if(szURL) + { + char text[szURL+1]; + strncpy(text,url,szURL); + text[szURL] = 0; + obj->hSession->set_url(text); + } + + } + catch(std::exception &e) { - char text[szURL+1]; - strncpy(text,url,szURL); - text[szURL] = 0; - obj->hSession->set_url(text); + zend_throw_error_exception(zend_exception_get_default(), (char *) e.what(), 0, 0 TSRMLS_DC); } } -- libgit2 0.21.2