Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor errors #130

Open
marioiordanov opened this issue Aug 15, 2023 · 9 comments
Open

Refactor errors #130

marioiordanov opened this issue Aug 15, 2023 · 9 comments
Assignees
Labels
Easy Task is easy to fix enhancement New feature or request

Comments

@marioiordanov
Copy link
Contributor

use starknet-rs generated errors

@marioiordanov marioiordanov added the enhancement New feature or request label Aug 15, 2023
@ivpavici ivpavici added OnlyDust ODHack Issue to assign for the ODHack event Easy Task is easy to fix labels Apr 19, 2024
@vibenedict
Copy link

Please kindly assign this task to me. Thanks

@PabloVillaplana
Copy link

Hello @ivpavici @marioiordanov I would love to be part of this effort! 👷🏽‍♂️, thanks (I am in OD Hack telegram, ready to start on Monday 🫡)

@vibenedict
Copy link

I started learning Rust recently and I think this issue will give me a head start working with errors in Rust. In order to tackle this issue, I would scan through the codebase for anywhere errors are being used and replace it with starknet-rs generated errors.

@mikiw mikiw assigned mikiw and vibenedict and unassigned mikiw Apr 22, 2024
@ivpavici
Copy link
Contributor

ivpavici commented Apr 22, 2024

~~@vibenedict please report frequently, if no progress si made during ~2 days we will assign @PabloVillaplana ~~

edit:
ok, so we can have only one assignee per issue, so I switched up for this one!

@PabloVillaplana
Copy link

PabloVillaplana commented Apr 22, 2024

@marioiordanov @ivpavici @FabijanC Do we have more context or can we update the issue description a little? 🤔

@ivpavici
Copy link
Contributor

ivpavici commented Apr 23, 2024

hello!
The issue means if we can potentially remove some error handling logic from our devnet code, and instead use the error handling logic from https://github.com/xJonathanLEI/starknet-rs
Maybe it is not possible, so some investigation and testing is needed from your side!

@PabloVillaplana
Copy link

Hello

I was currently reviewing the starknet-rs library that uses thiserror, they do not handle as such an error handling that we can export in our code, at least I think so.

Could someone give me some light to continue investigating? 👀

@ivpavici ivpavici removed the ODHack Issue to assign for the ODHack event label May 6, 2024
@PabloVillaplana PabloVillaplana removed their assignment Aug 28, 2024
@PabloVillaplana
Copy link

I am unassign me from this issue to give chance to another Dev

@marioiordanov
Copy link
Contributor Author

StarknetDevnetError to ApiError is good candidate for refactoring too. Possible solution is to implement From trait for ApiError with the most common StarknetDevnetError -> ApiError mappings. If there are differences in some of the methods, mapping will be done in the method.
For example in general:
StarknetDevnetError::NoStateAtBlock => ApiError::NoStateAtBlock

but in starknet_devnet<some_action>:
StarknetDevnetError::NoStateAtBlock => ApiError::BlockNotFound

@marioiordanov marioiordanov self-assigned this Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Task is easy to fix enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

5 participants