Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] WAM should return error code in hexadecimal #778

Open
jiasli opened this issue Jan 2, 2025 · 1 comment
Open

[Feature Request] WAM should return error code in hexadecimal #778

jiasli opened this issue Jan 2, 2025 · 1 comment

Comments

@jiasli
Copy link
Contributor

jiasli commented Jan 2, 2025

MSAL client type

Public

Problem Statement

Currently, WAM returns error code in decimal, resulting in negative numbers, such as -2147023584, -2147221164. Their corresponding hexadecimal values are 0x80070520, 0x80040154.

Even https://aka.ms/errors recommends using hex:

🤔 Inverting error code: query was -2147221164 which is more commonly expressed as 0x80040154.

In a search engine, - usually means "not to include". Searching for -2147221164 gives no result:

https://www.google.com/search?q=-2147221164

image

Proposed solution

WAM should return error code in hexadecimal.

@jiasli
Copy link
Contributor Author

jiasli commented Jan 2, 2025

The minus sign - is in those error codes does not really mean negative numbers. It is due to treating memory bytes as signed integers.

To convert theme back, we can use below Python code:

print((-2147023584).to_bytes(4, signed=True).hex())
print((-2147221164).to_bytes(4, signed=True).hex())

# output
80070520
80040154

See

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants