StreamError.composeLocation constructor

StreamError.composeLocation(
  1. StreamError streamError,
  2. ErrorLocation location
)

Init the StreamError from a previous StreamError, and add new ErrorLocation to StreamError.locations

Implementation

StreamError.composeLocation(StreamError streamError, ErrorLocation location) {
  this
    .._locations = [location, ...streamError.locations]
    .._error = streamError.error
    .._payload = streamError.payload;
}