Skip to content

Commit 5ee1614

Browse files
authored
Replace exception rethrow with finally
Closes #135
1 parent 5141f8f commit 5ee1614

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/MinecraftQuery.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,10 @@ public function Connect( $Ip, $Port = 25565, $Timeout = 3, $ResolveSRV = true )
4646

4747
$this->GetStatus( $Challenge );
4848
}
49-
// We catch this because we want to close the socket, not very elegant
50-
catch( MinecraftQueryException $e )
49+
finally
5150
{
5251
FClose( $this->Socket );
53-
54-
throw new MinecraftQueryException( $e->getMessage( ) );
5552
}
56-
57-
FClose( $this->Socket );
5853
}
5954

6055
public function GetInfo( )

0 commit comments

Comments
 (0)