Skip to content

Commit 8e12921

Browse files
committed
Improves error handling and updates API URLs
Enhances error reporting by decoding API URLs for clearer exception messages. Ensures 404 ignore state is preserved when retrieving phone numbers to prevent 404 exception.
1 parent e55723a commit 8e12921

File tree

180 files changed

+185
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+185
-181
lines changed

src/AbraFlexi/Adresar.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,13 @@ public function getCellPhoneNumber(string $purpose = '')
147147
public function getAnyPhoneNumber(string $purpose = '')
148148
{
149149
$phoneNo = null;
150+
$ignoreState = $this->ignoreNotFound();
151+
$this->ignore404(true);
150152
$numbersRaw = $this->getFlexiData(
151153
$this->getApiURL(),
152154
['detail' => 'custom:id,mobil,tel,kontakty(primarni,mobil,tel,odesilatFak,odesilatObj,odesilatNab,odesilatPpt,odesilatSkl,odesilatPok)', 'relations' => 'kontakty'],
153155
);
156+
$this->ignoreNotFound($ignoreState);
154157

155158
if (\is_array($numbersRaw) && !empty($numbersRaw[0])) {
156159
$numbers = $numbersRaw[0];

src/AbraFlexi/RO.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,8 @@ public function parseResponse($responseDecoded, $responseCode)
13381338

13391339
if ($this->throwException) {
13401340
$errors = $this->getErrors();
1341-
throw new Exception(empty($errors) ? 'Problem ' : ((\is_array($errors[0]) ? $errors[0]['message'] : $errors[0])).' '.$this->curlInfo['url'].' http error '.$this->lastResponseCode , $this);
1341+
1342+
throw new Exception(empty($errors) ? 'Problem ' : (\is_array($errors[0]) ? $errors[0]['message'] : $errors[0]).' '.urldecode($this->curlInfo['url']).' http error '.$this->lastResponseCode, $this);
13421343
}
13431344

13441345
$this->addStatusMessage($this->lastResponseCode.': '.$this->curlInfo['url'].' ('.$this->format.') '.json_encode($this->getErrors()), 'warning');
@@ -2506,11 +2507,11 @@ public function setMyKey($myKeyValue)
25062507
/**
25072508
* Set or get ignore not found pages flag.
25082509
*
2509-
* @param bool $ignore set flag to
2510+
* @param null|bool $ignore set flag to
25102511
*
25112512
* @return bool get flag state
25122513
*/
2513-
public function ignore404($ignore = null): bool
2514+
public function ignore404(?bool $ignore = null): bool
25142515
{
25152516
if (null !== $ignore) {
25162517
$this->ignoreNotFound = $ignore;

static/Properties.adresar-bankovni-ucet.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/Properties.adresar.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/Properties.analyza-zakazky.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/Properties.atribut.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/Properties.autotisk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"id":{"showToUser":"false","propertyName":"id","dbName":"IdAutoTisk","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"lastUpdate":{"showToUser":"false","propertyName":"lastUpdate","dbName":"lastUpdate","name":"Posledn\u00ed zm\u011bna","title":"Posledn\u00ed zm\u011bna","type":"datetime","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"pocet":{"showToUser":"true","propertyName":"pocet","dbName":"Pocet","name":"Kopi\u00ed","title":"Kopi\u00ed","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","minValue":"0.0","maxValue":"9.99999999E8","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"typTiskDoklK":{"showToUser":"true","propertyName":"typTiskDoklK","dbName":"TypTiskDoklK","name":"Tisknout doklad","title":"Tisknout doklad","type":"select","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"50","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","importableValues":{"value":{"@key":"typTiskDokladu.doklad","$":"Doklad"}},"links":null,"values":{"value":{"@key":"typTiskDokladu.doklad","$":"Doklad"}}},"report":{"showToUser":"true","propertyName":"report","dbName":"Report","name":"Report","title":"Report","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"sumovany":{"showToUser":"true","propertyName":"sumovany","dbName":"Sumovany","name":"Sumovan\u00fd","title":"Sumovan\u00fd","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"rozsireny":{"showToUser":"true","propertyName":"rozsireny","dbName":"Rozsireny","name":"Roz\u0161\u00ed\u0159en\u00fd","title":"Roz\u0161\u00ed\u0159en\u00fd","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"typDokl":{"showToUser":"true","propertyName":"typDokl","dbName":"IdTypDokl","name":"Typ dokladu","title":"Typ dokladu","type":"relation","fkName":"Typy doklad\u016f 30006","fkEvidencePath":"typ-dokladu","fkEvidenceType":"TYP_DOKLADU","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu\/c\/demo\/typ-dokladu","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}
1+
{"id":{"showToUser":"false","propertyName":"id","dbName":"IdAutoTisk","name":"ID","title":"ID","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"lastUpdate":{"showToUser":"false","propertyName":"lastUpdate","dbName":"lastUpdate","name":"Posledn\u00ed zm\u011bna","title":"Posledn\u00ed zm\u011bna","type":"datetime","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"true","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"false","isOverWritable":"false","hasBusinessLogic":"true","isUpperCase":"false","isLowerCase":"false","links":null},"pocet":{"showToUser":"true","propertyName":"pocet","dbName":"Pocet","name":"Kopi\u00ed","title":"Kopi\u00ed","type":"integer","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","minValue":"0.0","maxValue":"9.99999999E8","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"typTiskDoklK":{"showToUser":"true","propertyName":"typTiskDoklK","dbName":"TypTiskDoklK","name":"Tisknout doklad","title":"Tisknout doklad","type":"select","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","maxLength":"50","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","importableValues":{"value":{"@key":"typTiskDokladu.doklad","$":"Doklad"}},"links":null,"values":{"value":{"@key":"typTiskDokladu.doklad","$":"Doklad"}}},"report":{"showToUser":"true","propertyName":"report","dbName":"Report","name":"Report","title":"Report","type":"string","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"sumovany":{"showToUser":"true","propertyName":"sumovany","dbName":"Sumovany","name":"Sumovan\u00fd","title":"Sumovan\u00fd","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"rozsireny":{"showToUser":"true","propertyName":"rozsireny","dbName":"Rozsireny","name":"Roz\u0161\u00ed\u0159en\u00fd","title":"Roz\u0161\u00ed\u0159en\u00fd","type":"logic","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null},"typDokl":{"showToUser":"true","propertyName":"typDokl","dbName":"IdTypDokl","name":"Typ dokladu","title":"Typ dokladu","type":"relation","fkName":"Typy doklad\u016f 30006","fkEvidencePath":"typ-dokladu","fkEvidenceType":"TYP_DOKLADU","isVisible":"true","isSortable":"true","isHighlight":"false","inId":"false","inSummary":"false","inDetail":"true","inExpensive":"false","inMassUpdateable":"false","mandatory":"true","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","url":"http:\/\/demo.flexibee.eu:5434\/c\/demo\/typ-dokladu","links":null},"external-ids":{"showToUser":"false","propertyName":"external-ids","fkEvidencePath":"external-ids","dbName":"extid","name":"external-ids","title":"extIDs","type":"relation","isVisible":"true","isSortable":"false","isHighlight":"false","inId":"true","inSummary":"true","inDetail":"true","inExpensive":"false","mandatory":"false","isWritable":"true","isOverWritable":"true","hasBusinessLogic":"false","isUpperCase":"false","isLowerCase":"false","links":null}}

static/Properties.banka-polozka.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/Properties.banka.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

static/Properties.bankovni-ucet-pokladna.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)