StaticisCheck if the error is a MiddlewareError.
The error to check
Whether the error is a MiddlewareError
StaticwrapWrap an error in a MiddlewareError, unless it's a GraphBubbleUp error (like GraphInterrupt) which should propagate unchanged.
The error to wrap
The name of the middleware that threw the error
The original error if it's a GraphBubbleUp, otherwise a new MiddlewareError
Error thrown when a middleware fails.
Use
MiddlewareError.wrap()to create instances. The constructor is private to ensure that GraphBubbleUp errors (like GraphInterrupt) are never wrapped.