Feat/error handling

This is not middleware. This is just the struct that is inserted into the alloy.