Commit Graph

8 Commits (1d8cc984ab33ff14c8dddefe083e84074c4e2176)

Author SHA1 Message Date
Dave Tucker e899c8e408 WIP: Reduce Explosion of Aya Error Types
I have been down a rabbit hole of cleaning up the aya error types 😅

Most of the important changes are in `errors.rs`.

TL;DR

Current exposed types are:

- `EbpfError`
- `ProgramError`
- `MapError`
- `LinkError`
- `PerfBufferError`
- `SysError`

Honestly I'm still thinking about how we could collapse those types.
Either into a single type, or at least fewer than we expose today.

Within each of those types, I've tried to remove any invariants
that don't have any business being public (e.g if a syscall fails
with -EINVAL, there is nothing at runtime you can do about it
other than bailing).

👆 (and the spaghetti of errors depending on other errors) are
replaced by an `Other` invariant that's a Box<dyn std::error::Error>.

There are still some `pub(crate) XInternalError` types, but these
are used only to make nice error messages. This could plausibly be
replaced with anyhow/context etc.. But I've left it as-is for now.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
6 months ago
GrigorenkoPV 55ed9e0546
fix(aya-log): print &[u8] using full width (#1008)
Otherwise `&[1u8, 0u8]` cannot be distinguished from `&[0x10u8]` (they both become 10)
7 months ago
Alessandro Decina 60abea54ce chore(aya-log): bless API 1 year ago
Tamir Duberstein c302f8370d public-api: regenerate
Nightly now exposes `core::marker::Freeze`.

https://github.com/rust-lang/rust/pull/121840
1 year ago
Dave Tucker d0c244356f chore: Bless public API changes
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
1 year ago
dependabot[bot] b3ec33e763
build(deps): update public-api requirement from 0.32.0 to 0.33.1
Updates the requirements on [public-api](https://github.com/Enselic/cargo-public-api) to permit the latest version.
- [Release notes](https://github.com/Enselic/cargo-public-api/releases)
- [Changelog](https://github.com/Enselic/cargo-public-api/blob/main/rustdoc-json/CHANGELOG.md)
- [Commits](https://github.com/Enselic/cargo-public-api/compare/v0.32.0...v0.32.0)

---
updated-dependencies:
- dependency-name: public-api
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
1 year ago
Tamir Duberstein 8b3a93161d
xtask: bless API with new nightly 2 years ago
Dave Tucker f833f1fc1d xtask: Add cargo-public-api
Adds cargo-public-api. This allows for public API changes to get caught
in CI, requiring new changes to be "blessed" by using:

  cargo xtask public-api --bless

When this file is changed for aya, Alessandro will need to review the PR.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago