Skip to content

Commit a9e1842

Browse files
committed
Fix error handling bug
1 parent 73b3598 commit a9e1842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

afip/electronic_billing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def getLastVoucher(self, sales_point: int, type: int):
5050
"CbteTipo": type
5151
}
5252

53-
self.executeRequest("FECompUltimoAutorizado", req)["CbteNro"]
53+
return self.executeRequest("FECompUltimoAutorizado", req)["CbteNro"]
5454

5555
# Create a voucher from AFIP
5656
def createVoucher(self, data: dict, return_response: bool = False):
@@ -222,4 +222,4 @@ def __checkErrors(self, operation: str, results: dict):
222222
if res.get("Errors"):
223223
err = res["Errors"]["Err"][0] if type(res["Errors"]["Err"]) in (tuple, list) else res["Errors"]["Err"]
224224

225-
raise Exception("(%s) %s") % (err["Code"], err["Msg"])
225+
raise Exception("(%s) %s" % (err["Code"], err["Msg"]))

0 commit comments

Comments
 (0)