File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ pub enum WormholeCoreError {
4141 /// the server sent some bullshit message order
4242 #[ error( "Protocol error: {}" , _0) ]
4343 Protocol ( Box < str > ) ,
44+ /// The server sent us an error message
45+ #[ error( "Received error message from server: {}" , _0) ]
46+ Server ( Box < str > ) ,
4447 #[ error(
4548 "Key confirmation failed. If you didn't mistype the code, \
4649 this is a sign of an attacker guessing passwords. Please try \
@@ -397,11 +400,9 @@ pub async fn run(
397400 orig : _,
398401 } ) => {
399402 // TODO maybe hanlde orig field for better messages
400- // Also, make this a proper error type, maybe ServerError or RemoteError
401- actions. push_back ( Event :: ShutDown ( Err ( WormholeCoreError :: protocol ( format ! (
402- "Received error message from server: {}" ,
403- message
404- ) ) ) ) ) ;
403+ actions. push_back ( Event :: ShutDown ( Err ( WormholeCoreError :: Server (
404+ message. into ( ) ,
405+ ) ) ) ) ;
405406 } ,
406407 FromIO ( InboundMessage :: Pong { .. } ) | FromIO ( InboundMessage :: Ack { .. } ) => ( ) , /* we ignore this, it's only for the timing log */
407408 FromIO ( InboundMessage :: Unknown ) => {
You can’t perform that action at this time.
0 commit comments