Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/httpsys.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ char* verbs[] = {
"SEARCH"
};

const int LAST_ERROR_BUF_SIZE = 1024;
char lastCheckErrorBuf[LAST_ERROR_BUF_SIZE];
void SetLastFromCheckError(long err, const char *file, int line)
{
sprintf_s(lastCheckErrorBuf,LAST_ERROR_BUF_SIZE,"%s.%d Error Code: %i",file,line,err);
}

// Processing common to all callbacks from HTTP.SYS:
// - map the uv_async_t handle to uv_httpsys_t
// - decrement event loop reference count to indicate completion of async operation
Expand Down Expand Up @@ -824,7 +831,7 @@ Handle<Value> httpsys_listen(const Arguments& args)
uv_httpsys = NULL;
}

return handleScope.Close(ThrowException(Int32::New(hr)));
return handleScope.Close(ThrowException(String::New(lastCheckErrorBuf)));
}

Handle<Value> httpsys_stop_listen(const Arguments& args)
Expand Down
1 change: 1 addition & 0 deletions src/httpsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ using namespace v8;
if (S_OK != tmp_hr) \
{ \
hr = tmp_hr; \
SetLastFromCheckError(hr, __FILE__, __LINE__); \
goto Error; \
} \
}
Expand Down