Skip to content

Commit c6ea61c

Browse files
committed
fix formatting
1 parent f78d701 commit c6ea61c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

docs/zksync-error-howto.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,17 +303,13 @@ Suppose you want to throw an error from a component `AnvilEnvironment` of domain
303303
for example:
304304

305305

306-
```rust
307-
//replace the first line with the second
308-
let log_file = File::create(&config.log_file_path)?;
309-
// Instead of returning `std::io::Error` you now return `anvil::gen::GenericError` containing it
310-
let log_file = File::create(&config.log_file_path).map_err(to_generic)?;
311-
```
312-
313-
-
314-
315-
```rust
316-
//This is equivalent to `return anyhow!(error)`
306+
```rust
307+
//replace the first line with the second
308+
let log_file = File::create(&config.log_file_path)?;
309+
// Instead of returning `std::io::Error` you now return `anvil::gen::GenericError` containing it
310+
let log_file = File::create(&config.log_file_path).map_err(to_generic)?;
311+
312+
//This is equivalent to `return anyhow!(error)`
317313
anyhow::bail!(
318314
"fork is using unsupported fee parameters: {:?}",
319315
fork_client.details.fee_params
@@ -331,7 +327,8 @@ return Err(generic_error!(
331327
"fork is using unsupported fee parameters: {:?}",
332328
fork_client.details.fee_params
333329
))
334-
```
330+
```
331+
335332
2. Introduce more errors, corresponding to different failure situations.
336333

337334
Describe the new error in the JSON file, and replace it on the throw site.
@@ -376,3 +373,5 @@ If a function may return errors that are spread among components (e.g. either
376373
type `AnvilError` from it.
377374
Such function are rare and require more manual work, but the algorithm is the
378375
same -- just use `to_domain` helper along with `generic_error!` macro.
376+
377+

0 commit comments

Comments
 (0)