Decode HResult = -2147467259
Asked Answered
H

5

45

Can someone help me decode this HResult? What does it mean? I know the negative stands for a failure. How about the rest of the 10 bits?

I referenced MSDN HResult article here, but I am not sure how to determine what my facility and code bits are.

More info:

_message: "External component has thrown an exception."
Data: {System.Collections.ListDictionaryInternal}

Hybridize answered 18/3, 2014 at 23:53 Comment(4)
I got this error when I attempted to post back some data which is more than usual. Can this be the source of error? Too much data?Hybridize
Maybe. Hard to say. Can you post a small, self-contained example that reproduces the problem? If so, post it here. Better yet, post a different question with that information.Batsman
Thank you all for answering my question. I dug in further i found out the error was due to exceeding the maximium number of aspnet:MaxHttpCollectionKeys. Increasing this number will fix the error.Hybridize
For future use, I wrote an HRESULT decoder that explains how to decode this value (and any others).Aracelis
A
90

I'll show you how to do it. Paste the negative number into Calculator (Windows) in programmer mode "Dec" setting. Then convert to "Hex" setting. You get the number: FFFFFFFF80004005. The error is 80004005 which is:

0x80004005
E_FAIL
Unspecified 

Unfortunately the provider of the function that gave you this error did not categorize the error.

Useful links:

  1. MSDN - HRESULT Format
  2. MSDN - HRESULT Error List
Amplexicaul answered 18/3, 2014 at 23:57 Comment(3)
+1. A couple of notes for readers: (1) Make sure to include the minus sign, easiest way is to subtract the number from 0 and press = (2) If you have DWORD selected, it will strip out the redundant FFFFFFFF part for you.Jameson
Also, an even easier option for whoever missed Stephen Cleary's comment on the the question: errorcodelookup.com/?type=hresult&code=80004005Jameson
Very nice answer! :-)Gymnasium
M
4

Print it as an hexadecimal number, then, use for instance, VisualStudio ErrorLookup, to get the message.

Messene answered 18/3, 2014 at 23:57 Comment(1)
With Visual studio 2022 it takes negative integers too. It automatically converts the negative number to hex. Not sure if this is a recent feature or has it always been like this.Blanchette
N
4

Another way to do it is as follows. An HRESULT should contain a System Error Code in its first 32 bits. Using an AND operation will retrieve the error code from the HRESULT:

int result = (-2147467259 & 0xFFFF)

result is 16389, which is not a part of the System Error Codes list, and as a result, is unspecified.

Nasalize answered 19/1, 2015 at 23:20 Comment(0)
B
3

-2147467259 in decimal is 80004005 in hexadecimal (usually rendered as 0x80004005). That's "E_FAIL (Unspecified error)" in Win32.

Not a very helpful error code, but maybe it'll get you a half-step closer to a solution.

Batsman answered 18/3, 2014 at 23:57 Comment(0)
B
2

Decoding the error code with tools.

  1. Visual Studio Error lookup tool (link)
  2. Microsoft Err.exe command line tool (standalone) (link) (download)
  3. Online utility - https://errorcodelookup.com

1. Visual Studio Error lookup tool

Usage: enter image description here

Locating the tool in Visual Studio (VS 2022):

enter image description here

On my system it is present at the following location:

"C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Tools\errlook.exe"

2. Microsoft Err.exe command line

Microsoft also has a standalone commandline tool for decoding HRESULT errors: Err.exe. You need not install visual studio for this.

Usage:

PS C:\Users\j\Downloads> .\Err_6.4.5.exe 0x80004027
# for hex 0x80004027 / decimal -2147467225
  CO_E_CLASS_DISABLED                                            winerror.h
# The component or application containing the component has
# been disabled.
# 1 matches found for "0x80004027"
PS C:\Users\j\Downloads> .\Err_6.4.5.exe -2147467225
# for decimal -2147467225 / hex 0x80004027
  CO_E_CLASS_DISABLED                                            winerror.h
# The component or application containing the component has
# been disabled.
# 1 matches found for "-2147467225"

enter image description here

0x80004027 (-2147467225) is the error code above. As you can see it accepts both hex, and negative integers.

3. Online utility - https://errorcodelookup.com

The website allows you to decode error codes online.

eg. https://errorcodelookup.com/?q=0x80004027

enter image description here

PS: The answer expands upon @BenjaminB's answer with some of my learnings. The error lookup tool is suggested in a comment by @Ohad Schneider.

Blanchette answered 18/1 at 5:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.