Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Rename CustomError to Custom #9207

Merged
merged 4 commits into from
Apr 1, 2020

Conversation

jackcmay
Copy link
Contributor

@jackcmay jackcmay commented Mar 31, 2020

Problem

Redudent "Error" in InstructionError::CustomError and ProgramError::CustomError

Summary of Changes

Rename it to Custom

Fixes #

@jackcmay
Copy link
Contributor Author

@mvines @jstarry Backward incompatible but would be a nice nit cleanup. Would also nice to be able to apply this to InstructionError::CustomError. Thoughts?

@mvines
Copy link
Contributor

mvines commented Mar 31, 2020

This doesn't worry me, it's source backwards incompatible but no affect to binaries AFAICT

@jackcmay
Copy link
Contributor Author

@mvines, Thoughts on also modifying InstructionError::CustomError?

@mvines
Copy link
Contributor

mvines commented Apr 1, 2020

wfm

@codecov
Copy link

codecov bot commented Apr 1, 2020

Codecov Report

Merging #9207 into master will decrease coverage by 0.0%.
The diff coverage is 19.2%.

@@           Coverage Diff            @@
##           master   #9207     +/-   ##
========================================
- Coverage    81.0%   81.0%   -0.1%     
========================================
  Files         276     276             
  Lines       60896   60928     +32     
========================================
+ Hits        49365   49368      +3     
- Misses      11531   11560     +29     

@jackcmay jackcmay force-pushed the rename-customerror branch from b09e986 to 528ab8d Compare April 1, 2020 03:21
@@ -116,7 +116,7 @@ pub enum InstructionError {
/// by the Solana runtime. A program-specific error may be any type that is represented as
/// or serialized to a u32 integer.
#[error("program error: {0:#x}")]
CustomError(u32),
Custom(u32),
Copy link
Contributor

Choose a reason for hiding this comment

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

the error message above says "program error", should we rename Custom to Program?

Copy link
Contributor

@jstarry jstarry Apr 1, 2020

Choose a reason for hiding this comment

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

Never mind, I think Custom makes more sense.

nit: how about updating the error message to "custom program error"?

jstarry
jstarry previously approved these changes Apr 1, 2020
@mergify mergify bot dismissed jstarry’s stale review April 1, 2020 05:04

Pull request has been modified.

@jackcmay jackcmay merged commit 268e04c into solana-labs:master Apr 1, 2020
@jackcmay jackcmay deleted the rename-customerror branch April 1, 2020 16:01
CriesofCarrots pushed a commit to CriesofCarrots/solana that referenced this pull request Apr 30, 2020
CriesofCarrots pushed a commit to CriesofCarrots/solana that referenced this pull request Apr 30, 2020
CriesofCarrots added a commit that referenced this pull request May 1, 2020
* Add program_error conversions (#9203)

* Rename CustomError to Custom (#9207)

* More custom error rename (#9227)

automerge

* Remove librapay conflicts

* Fix rebase

Co-authored-by: Jack May <jack@solana.com>
mergify bot pushed a commit that referenced this pull request May 1, 2020
* Add program_error conversions (#9203)

* Rename CustomError to Custom (#9207)

* More custom error rename (#9227)

automerge

* Remove librapay conflicts

* Fix rebase

Co-authored-by: Jack May <jack@solana.com>
(cherry picked from commit 3aa52f9)

# Conflicts:
#	programs/librapay/Cargo.lock
#	programs/librapay/src/librapay_transaction.rs
#	programs/move_loader/src/processor.rs
#	runtime/src/bank/mod.rs
CriesofCarrots added a commit that referenced this pull request May 1, 2020
* Add program_error conversions (#9203)

* Rename CustomError to Custom (#9207)

* More custom error rename (#9227)

automerge

* Remove librapay conflicts

* Fix rebase

Co-authored-by: Jack May <jack@solana.com>
(cherry picked from commit 3aa52f9)
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