Skip to content

compilation error when using actix-ws v0.3.0 with actix-web v4.12Β #634

@Baptistemontan

Description

@Baptistemontan

When compiling actix-ws v0.3.0 with actix-web v4.12 this error is emitted:

error[E0277]: the trait bound `ProtocolError: Into<actix_web::Error>` is not satisfied
   --> actix-ws\src\stream.rs:140:49
    |
140 |                 return Poll::Ready(Some(Err(err.into())));
    |                                                 ^^^^ the trait `ResponseError` is not implemented for `ProtocolError`
    |
    = help: the following other types implement trait `ResponseError`:
              BlockingError
              Box<(dyn std::error::Error + 'static)>
              HttpError
              Infallible
              InvalidHeaderValue
              JsonPayloadError
              PathError
              PayloadError
            and 14 others
    = note: required for `actix_web::Error` to implement `std::convert::From<ProtocolError>`
    = note: required for `ProtocolError` to implement `Into<actix_web::Error>`

error[E0277]: `?` couldn't convert the error: `HandshakeError: ResponseError` is not satisfied
  --> actix-ws\src\lib.rs:75:45
   |
74 | ) -> Result<(HttpResponse, Session, MessageStream), actix_web::Error> {
   |      ---------------------------------------------------------------- required `HandshakeError: ResponseError` because of this
75 |     let mut response = handshake(req.head())?;
   |                        ---------------------^ the trait `ResponseError` is not implemented for `HandshakeError`
   |                        |
   |                        this has type `Result<_, HandshakeError>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
   = help: the following other types implement trait `ResponseError`:
             BlockingError
             Box<(dyn std::error::Error + 'static)>
             HttpError
             Infallible
             InvalidHeaderValue
             JsonPayloadError
             PathError
             PayloadError
           and 14 others
   = note: required for `actix_web::Error` to implement `std::convert::From<HandshakeError>`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `actix-ws` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions