MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / get_error_message

Function get_error_message

keepercommander/native.py:63–76  ·  view source on GitHub ↗
(error_code)

Source from the content-addressed store, hash-verified

61 flags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS
62
63 def get_error_message(error_code): # type: (int) -> str
64 message_buffer = ctypes.create_unicode_buffer(0)
65 length = ctypes.windll.kernel32.FormatMessageW(
66 flags,
67 None, # Message source
68 error_code, # Message identifier
69 0, # Language ID
70 ctypes.byref(message_buffer), # Buffer
71 0, # Size
72 None # Arguments
73 )
74 if length:
75 return message_buffer.value.strip()
76 return 'Unknown'
77
78
79def run_as(username, password, application): # type: (str, str, str) -> None

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected