Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
d8ed5870
Unverified
Commit
d8ed5870
authored
Aug 12, 2020
by
Stan Kladko
Committed by
GitHub
Aug 12, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #138 from skalenetwork/SKALE-3067-cleanup-improve-sgx
Skale 3067 cleanup improve sgx
parents
20362fb3
6c340277
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
78 deletions
+99
-78
Log.h
Log.h
+23
-4
SGXWalletServer.cpp
SGXWalletServer.cpp
+76
-74
No files found.
Log.h
View file @
d8ed5870
...
@@ -73,11 +73,30 @@ public:
...
@@ -73,11 +73,30 @@ public:
static
void
handleSGXException
(
Json
::
Value
&
_result
,
SGXException
&
_e
);
static
void
handleSGXException
(
Json
::
Value
&
_result
,
SGXException
&
_e
);
};
};
#define INIT_RESULT(__RESULT__) Json::Value __RESULT__; __RESULT__["status"] = 0; __RESULT__["errorMessage"] = \
#define INIT_RESULT(__RESULT__) Json::Value __RESULT__; \
int errStatus = UNKNOWN_ERROR; string errMsg(BUF_LEN, '\0');__RESULT__["status"] = 0; __RESULT__["errorMessage"] = \
"Server error. Please see server log.";
"Server error. Please see server log.";
#define RESULT_SUCCESS(__RESULT__) ; __RESULT__["status"] = 0; __RESULT__["errorMessage"] = "";
#define HANDLE_SGX_EXCEPTION(_RESULT_) catch (SGXException &__e) { Log::handleSGXException(_RESULT_, __e);} \
#define HANDLE_SGX_EXCEPTION(__RESULT__) \
catch (exception &__e) {spdlog::error(__e.what()); _RESULT_["status"] = 1; _RESULT_["errorMessage"] = __e.what();}
catch (SGXException& _e) { \
__RESULT__["status"] = _e.status; \
__RESULT__["errorMessage"] = _e.errString; \
return __RESULT__; \
} catch (exception& _e) { \
__RESULT__["errorMessage"] = _e.what(); \
return __RESULT__; \
}\
catch (...) { \
exception_ptr p = current_exception(); \
printf("Exception %s \n", p.__cxa_exception_type()->name()); \
__RESULT__["errorMessage"] = "Unknown exception"; \
return __RESULT__; \
}
#define RETURN_SUCCESS(__RESULT__) \
__RESULT__["status"] = 0; \
__RESULT__["errorMessage"] = ""; \
return __RESULT__;
#endif
#endif
SGXWalletServer.cpp
View file @
d8ed5870
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment