diff --git a/msrest/exceptions.py b/msrest/exceptions.py
index 6ac7dcc..3b8788e 100644
--- a/msrest/exceptions.py
+++ b/msrest/exceptions.py
@@ -136,7 +136,13 @@ class HttpOperationError(ClientException):
                 self.error = deserialize(resp_type, response)
                 if self.error is None:
                     self.error = deserialize.dependencies[resp_type]()
-                self.message = self.error.message
+                # ARM uses OData v4
+                # http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091
+                # Code and Message are REQUIRED
+                self.message = "({}) {}".format(
+                    self.error.error.code,
+                    self.error.error.message
+                )
         except (DeserializationError, AttributeError, KeyError):
             pass
 

Improve exception string if custom exception
Example, with this:
https://github.com/Azure/azure-sdk-for-python/blob/master/azure-mgmt-billing/azure/mgmt/billing/models/error_response.py

And this answer:
```python
{
	"error": {
		"code": "NotOptedIn",
		"message": "You are not allowed to download invoices. Please contact your account administrator (ptvsazure@outlook.com) to turn on access in the management portal for allowing to download invoices through the API."
	}
}
```

We should have something better than:
```python

D:\VEnvs\AzureCli\Lib\site-packages\azure\mgmt\billing\operations\invoices_operations.py in internal_paging(next_link, raw)
    110
    111             if response.status_code not in [200]:
--> 112                 raise models.ErrorResponseException(self._deserialize, response)
    113
    114             return response

ErrorResponseException: Operation returned an invalid status code 'Unauthorized'
```

We loose the message
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
new file mode 100644
index 0000000..2995593
--- /dev/null
+++ b/tests/test_exceptions.py
@@ -0,0 +1,92 @@
+#--------------------------------------------------------------------------
+#
+# Copyright (c) Microsoft Corporation. All rights reserved. 
+#
+# The MIT License (MIT)
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the ""Software""), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+#--------------------------------------------------------------------------
+import json
+import unittest
+try:
+    from unittest import mock
+except ImportError:
+    import mock
+
+import requests
+
+from msrest.serialization import Model, Deserializer
+from msrest.exceptions import HttpOperationError
+
+
+class TestExceptions(unittest.TestCase):
+
+    def test_custom_exception(self):
+
+        class ErrorResponse(Model):
+            _attribute_map = {
+                'error': {'key': 'error', 'type': 'ErrorDetails'},
+            }
+            def __init__(self, error=None):
+                self.error = error
+
+
+        class ErrorResponseException(HttpOperationError):
+            def __init__(self, deserialize, response, *args):
+                super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
+
+        class ErrorDetails(Model):
+            _validation = {
+                'code': {'readonly': True},
+                'message': {'readonly': True},
+                'target': {'readonly': True},
+            }
+
+            _attribute_map = {
+                'code': {'key': 'code', 'type': 'str'},
+                'message': {'key': 'message', 'type': 'str'},
+                'target': {'key': 'target', 'type': 'str'},
+            }
+
+            def __init__(self):
+                self.code = None
+                self.message = None
+                self.target = None
+
+        deserializer = Deserializer({
+            'ErrorResponse': ErrorResponse,
+            'ErrorDetails': ErrorDetails
+        })
+
+        response = mock.create_autospec(requests.Response)
+        response.text = json.dumps(
+            {
+                "error": {
+                    "code": "NotOptedIn",
+                    "message": "You are not allowed to download invoices. Please contact your account administrator (ptvsazure@outlook.com) to turn on access in the management portal for allowing to download invoices through the API."
+                }
+            }            
+        )
+        response.headers = {"content-type": "application/json; charset=utf8"}
+
+        excep = ErrorResponseException(deserializer, response)
+
+        self.assertIn("NotOptedIn", str(excep))
+        self.assertIn("You are not allowed to download invoices", str(excep))

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
charset-normalizer==3.4.1
coverage==7.8.0
exceptiongroup==1.2.2
idna==3.10
iniconfig==2.1.0
isodate==0.7.2
-e git+https://github.com/Azure/msrest-for-python.git@bb876c23427448d293c793e16d415971eb1753bc#egg=msrest
oauthlib==3.2.2
packaging==24.2
pluggy==1.5.0
pytest==8.3.5
pytest-cov==6.0.0
requests==2.32.3
requests-oauthlib==2.0.0
tomli==2.2.1
urllib3==2.3.0

name: msrest-for-python
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
      - charset-normalizer==3.4.1
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - idna==3.10
      - iniconfig==2.1.0
      - isodate==0.7.2
      - oauthlib==3.2.2
      - packaging==24.2
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - requests==2.32.3
      - requests-oauthlib==2.0.0
      - tomli==2.2.1
      - urllib3==2.3.0
prefix: /opt/conda/envs/msrest-for-python

tests/test_exceptions.py::TestExceptions::test_custom_exception
msrest/exceptions.py
msrest/exceptions.py