Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Stateful Response Error Codes #1837

Merged
merged 6 commits into from
Nov 14, 2018
Merged

Stateful Response Error Codes #1837

merged 6 commits into from
Nov 14, 2018

Conversation

Akvinikym
Copy link
Contributor

Description of the Change

This PR trunk introduces error codes for stateful response. Numeric values, described in the following POW, are returned the to the client instead of long and insecure error messages.

Benefits

More security and easier to parse by the client.

Possible Drawbacks

Less information about the error, which happened during validation.

* Introduced error codes to SQL

Signed-off-by: Akvinikym <[email protected]>

* Builds

Signed-off-by: Akvinikym <[email protected]>

* 4/16 commands

Signed-off-by: Akvinikym <[email protected]>

* 13/16 done

Signed-off-by: Akvinikym <[email protected]>

* Tests are finished

Signed-off-by: Akvinikym <[email protected]>

* Review issues

Signed-off-by: Akvinikym <[email protected]>

* Added a separated function for parsing SQL errors and making an error

Signed-off-by: Akvinikym <[email protected]>

* Review issues are addressed

Signed-off-by: Akvinikym <[email protected]>

* Added ToDos

Signed-off-by: Akvinikym <[email protected]>

* Some after-POW issues

Signed-off-by: Akvinikym <[email protected]>

* Error codes has good ordering

Signed-off-by: Akvinikym <[email protected]>

* More fixes

Signed-off-by: Akvinikym <[email protected]>

* Build fix

Signed-off-by: Akvinikym <[email protected]>

* And more

Signed-off-by: Akvinikym <[email protected]>

* Refactored switch-case

Signed-off-by: Akvinikym <[email protected]>
* Introduced error codes to SQL

Signed-off-by: Akvinikym <[email protected]>

* Builds

Signed-off-by: Akvinikym <[email protected]>

* 4/16 commands

Signed-off-by: Akvinikym <[email protected]>

* 13/16 done

Signed-off-by: Akvinikym <[email protected]>

* Tests are finished

Signed-off-by: Akvinikym <[email protected]>

* Review issues

Signed-off-by: Akvinikym <[email protected]>

* Introduced error codes to SFV

Signed-off-by: Akvinikym <[email protected]>

* Is now built

Signed-off-by: Akvinikym <[email protected]>

* Added a separated function for parsing SQL errors and making an error

Signed-off-by: Akvinikym <[email protected]>

* Review issues are addressed

Signed-off-by: Akvinikym <[email protected]>

* Added ToDos

Signed-off-by: Akvinikym <[email protected]>

* Some after-POW issues

Signed-off-by: Akvinikym <[email protected]>

* Error codes has good ordering

Signed-off-by: Akvinikym <[email protected]>

* More fixes

Signed-off-by: Akvinikym <[email protected]>

* Build fix

Signed-off-by: Akvinikym <[email protected]>

* And more

Signed-off-by: Akvinikym <[email protected]>

* Refactored switch-case

Signed-off-by: Akvinikym <[email protected]>
* Introduced error codes to SQL

Signed-off-by: Akvinikym <[email protected]>

* Builds

Signed-off-by: Akvinikym <[email protected]>

* 4/16 commands

Signed-off-by: Akvinikym <[email protected]>

* 13/16 done

Signed-off-by: Akvinikym <[email protected]>

* Tests are finished

Signed-off-by: Akvinikym <[email protected]>

* Review issues

Signed-off-by: Akvinikym <[email protected]>

* Introduced error codes to SFV

Signed-off-by: Akvinikym <[email protected]>

* Is now built

Signed-off-by: Akvinikym <[email protected]>

* Error code is introduced, and tests are up

Signed-off-by: Akvinikym <[email protected]>

* Added a separated function for parsing SQL errors and making an error

Signed-off-by: Akvinikym <[email protected]>

* Review issues are addressed

Signed-off-by: Akvinikym <[email protected]>

* Added ToDos

Signed-off-by: Akvinikym <[email protected]>

* Some after-POW issues

Signed-off-by: Akvinikym <[email protected]>

* Error codes has good ordering

Signed-off-by: Akvinikym <[email protected]>

* More fixes

Signed-off-by: Akvinikym <[email protected]>

* Build fix

Signed-off-by: Akvinikym <[email protected]>

* And more

Signed-off-by: Akvinikym <[email protected]>

* Refactored switch-case

Signed-off-by: Akvinikym <[email protected]>

* Review issues are fixed

Signed-off-by: Akvinikym <[email protected]>

* Little issue

Signed-off-by: Akvinikym <[email protected]>

* Another issue

Signed-off-by: Akvinikym <[email protected]>
Copy link
Contributor

@nickaleks nickaleks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix minor issues

};
case TxStatusType::kEnoughSignaturesCollected: {
builder = builder.enoughSignaturesCollected();
break;
status_bus_->publish(status_factory_->makeEnoughSignaturesCollected(hash, tx_error));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting?

@Akvinikym Akvinikym merged commit ca882c6 into dev Nov 14, 2018
@Akvinikym Akvinikym deleted the trunk/stf-rsp-err-codes branch November 14, 2018 10:03
laSinteZ referenced this pull request in soramitsu/iroha-helpers Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants