andreroggeri: Nice catch ! Would you mind adding a new test to catch this scenario ?
coveralls: 
[![Coverage Status](https://coveralls.io/builds/26660815/badge)](https://coveralls.io/builds/26660815)

Coverage remained the same at 100.0% when pulling **e59c3d60fe03e142740a92fb3b3f2b97fc8c5928 on marcoaaguiar:master** into **4e3c7ca641da2b557137c649911e222e752eea1c on andreroggeri:master**.

marcoaaguiar: I dont have experience with pytest but created a few test to cover the attributes of NuException. Could you check if it is correct?
diff --git a/pynubank/nubank.py b/pynubank/nubank.py
index d38a582..f7174db 100644
--- a/pynubank/nubank.py
+++ b/pynubank/nubank.py
@@ -18,9 +18,8 @@ PAYMENT_EVENT_TYPES = (
 
 
 class NuException(Exception):
-
     def __init__(self, status_code, response, url):
-        super().__init__()
+        super().__init__(f'The request made failed with HTTP status code {status_code}')
         self.url = url
         self.status_code = status_code
         self.response = response
@@ -81,8 +80,7 @@ class Nubank:
 
     def _handle_response(self, response: Response) -> dict:
         if response.status_code != 200:
-            raise NuException(f'The request made failed with HTTP status code {response.status_code}',
-                              response.status_code, response.json())
+            raise NuException(response.status_code, response.json(), response.url)
 
         return response.json()
 

NuException does not show which status code I actually got
exception looks like this:

```
Traceback (most recent call last):
  File "main.py", line 11, in <module>
    nu.authenticate_with_qr_code(os.environ['NU_CPF'], os.environ['NU_PWD'], uuid)
  File "/usr/local/lib/python3.8/site-packages/pynubank/nubank.py", line 96, in authenticate_with_qr_code
    auth_data = self._password_auth(cpf, password)
  File "/usr/local/lib/python3.8/site-packages/pynubank/nubank.py", line 79, in _password_auth
    data = self._handle_response(response)
  File "/usr/local/lib/python3.8/site-packages/pynubank/nubank.py", line 84, in _handle_response
    raise NuException(f'The request made failed with HTTP status code {response.status_code}',
pynubank.nubank.NuException
make: *** [run] Error 1
```

its probably a 422, but I think it should show it here...
diff --git a/requirements-test.txt b/requirements-test.txt
index 39f5d78..a64d515 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -1,4 +1,4 @@
 -r requirements.txt
-pytest==5.0.1
+pytest==5.2.2
 pytest-cov==2.7.1
 coveralls==1.8.1
diff --git a/tests/test_nubank_client.py b/tests/test_nubank_client.py
index ba1a5ba..83c6a46 100644
--- a/tests/test_nubank_client.py
+++ b/tests/test_nubank_client.py
@@ -684,7 +684,7 @@ def test_get_qr_code():
     assert isinstance(qr, QRCode)
 
 
-@pytest.mark.parametrize("http_status", [
+@pytest.mark.parametrize('http_status', [
     100, 101, 102, 103,
     201, 202, 203, 204, 205, 206, 207, 208, 226,
     300, 301, 302, 303, 304, 305, 306, 307, 308,
@@ -699,3 +699,43 @@ def test_nubank_request_handler_throws_exception_on_status_different_of_200(http
     client = Nubank()
     with pytest.raises(NuException):
         client._handle_response(response)
+
+
+@patch.object(Nubank, '_update_proxy_urls', fake_update_proxy)
+def test_nubank_request_handler_throws_exception_with_status_code_attribute():
+    http_status = 400
+    response = create_fake_response({}, http_status)
+    client = Nubank()
+    with pytest.raises(NuException) as exception_info:
+        client._handle_response(response)
+
+    assert exception_info.value.status_code == http_status
+
+
+@patch.object(Nubank, '_update_proxy_urls', fake_update_proxy)
+def test_nubank_request_handler_throws_exception_status_code_in_the_exception_message():
+    http_status = 400
+    response = create_fake_response({}, http_status)
+    client = Nubank()
+    with pytest.raises(NuException, match=fr'.*{http_status}.*'):
+        client._handle_response(response)
+
+
+@patch.object(Nubank, '_update_proxy_urls', fake_update_proxy)
+def test_nubank_request_handler_throws_exception_with_url_attribute():
+    response = create_fake_response({}, 400)
+    client = Nubank()
+    with pytest.raises(NuException) as exception_info:
+        client._handle_response(response)
+
+    assert exception_info.value.url == response.url
+
+
+@patch.object(Nubank, '_update_proxy_urls', fake_update_proxy)
+def test_nubank_request_handler_throws_exception_with_response_attribute():
+    response = create_fake_response({}, 400)
+    client = Nubank()
+    with pytest.raises(NuException) as exception_info:
+        client._handle_response(response)
+
+    assert exception_info.value.response == response.json()

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov coveralls
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
chardet==3.0.4
coverage==7.8.0
coveralls==4.0.1
docopt==0.6.2
exceptiongroup==1.2.2
idna==2.8
iniconfig==2.1.0
packaging==24.2
pluggy==1.5.0
-e git+https://github.com/andreroggeri/pynubank.git@4e3c7ca641da2b557137c649911e222e752eea1c#egg=pynubank
pytest==8.3.5
pytest-cov==6.0.0
qrcode==6.1
requests==2.22.0
six==1.17.0
tomli==2.2.1
urllib3==1.25.11

name: pynubank
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - chardet==3.0.4
      - coverage==7.8.0
      - coveralls==4.0.1
      - docopt==0.6.2
      - exceptiongroup==1.2.2
      - idna==2.8
      - iniconfig==2.1.0
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - qrcode==6.1
      - requests==2.22.0
      - six==1.17.0
      - tomli==2.2.1
      - urllib3==1.25.11
prefix: /opt/conda/envs/pynubank

tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_with_status_code_attribute tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_status_code_in_the_exception_message tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_with_url_attribute tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_with_response_attribute
tests/test_nubank_client.py::test_authenticate_with_qr_code_succeeds tests/test_nubank_client.py::test_authentication_with_qr_code_failure_raise_exception tests/test_nubank_client.py::test_get_card_feed tests/test_nubank_client.py::test_get_bills tests/test_nubank_client.py::test_get_bill_details tests/test_nubank_client.py::test_get_card_statements tests/test_nubank_client.py::test_get_account_balance tests/test_nubank_client.py::test_get_account_feed tests/test_nubank_client.py::test_get_account_statements tests/test_nubank_client.py::test_grapql_query_raises_exeption tests/test_nubank_client.py::test_get_qr_code tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[100] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[101] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[102] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[103] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[201] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[202] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[203] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[204] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[205] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[206] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[207] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[208] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[226] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[300] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[301] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[302] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[303] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[304] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[305] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[306] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[307] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[308] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[400] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[401] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[402] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[403] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[404] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[405] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[406] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[407] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[408] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[409] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[410] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[411] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[412] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[413] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[414] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[415] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[416] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[417] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[418] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[420] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[421] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[422] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[423] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[424] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[426] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[428] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[429] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[431] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[440] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[444] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[449] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[450] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[451] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[495] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[496] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[497] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[498] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[499] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[500] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[501] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[502] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[503] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[504] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[505] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[506] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[507] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[508] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[509] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[510] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[511] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[520] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[521] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[522] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[523] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[524] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[525] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[526] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[527] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[530] tests/test_nubank_client.py::test_nubank_request_handler_throws_exception_on_status_different_of_200[598]
pynubank/nubank.py
pynubank/nubank.py