10
10
11
11
namespace Multinexo \WSFE ;
12
12
13
+ use Multinexo \Exceptions \AfipUnhandledException ;
13
14
use Multinexo \Exceptions \ManejadorResultados ;
14
15
use Multinexo \Exceptions \WsException ;
15
16
use Multinexo \Models \AfipConfig ;
@@ -112,7 +113,11 @@ public function FECAESolicitar($data)
112
113
$ this ->resultado ->procesar ($ resultado );
113
114
114
115
if (reset ($ resultado )->FeDetResp ->FECAEDetResponse ->Resultado === 'R ' ) {
115
- $ observaciones = reset ($ resultado )->FeDetResp ->FECAEDetResponse ->Observaciones ->Obs ->Msg ;
116
+ $ observaciones = reset ($ resultado )->FeDetResp ->FECAEDetResponse ->Observaciones ->Obs ->Msg ?? '' ;
117
+
118
+ if (empty ($ observaciones )) {
119
+ throw new AfipUnhandledException (print_r ('FECAEDetResponse: ' . reset ($ resultado )->FeDetResp ->FECAEDetResponse , true ));
120
+ }
116
121
117
122
throw new WsException ($ observaciones );
118
123
}
@@ -477,6 +482,11 @@ public function FEParamGetPtosVenta()
477
482
* Desc string(250) Descripción
478
483
* FchDesde string(8) Fecha de vigencia desde
479
484
* FchHasta string(8) Fecha de vigencia hasta
485
+ *
486
+ * @throws AfipUnhandledException
487
+ * @throws WsException
488
+ *
489
+ * @return mixed
480
490
*/
481
491
public function FEParamGetTiposCbte ()
482
492
{
@@ -486,6 +496,10 @@ public function FEParamGetTiposCbte()
486
496
487
497
$ this ->resultado ->procesar ($ resultado );
488
498
499
+ if (!isset ($ resultado ->FEParamGetTiposCbteResult ->ResultGet )) {
500
+ throw new AfipUnhandledException ('ResultGet not defined: ' . print_r ($ resultado , true ));
501
+ }
502
+
489
503
return $ resultado ->FEParamGetTiposCbteResult ->ResultGet ;
490
504
}
491
505
0 commit comments