1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:17:45 +00:00

Chess: Slightly improve error propagation during startup

This commit is contained in:
Ben Wiederhake 2023-05-07 01:59:10 +02:00 committed by Jelle Raaijmakers
parent 0fe29a48ad
commit 449911c286
4 changed files with 14 additions and 15 deletions

View file

@ -12,14 +12,6 @@
namespace Chess::UCI {
Endpoint::Endpoint(NonnullOwnPtr<Core::File> in, NonnullOwnPtr<Core::File> out)
: m_in_fd(in->fd())
, m_in(Core::BufferedFile::create(move(in)).release_value_but_fixme_should_propagate_errors())
, m_out(move(out))
{
set_in_notifier();
}
void Endpoint::send_command(Command const& command)
{
auto command_string = command.to_string().release_value_but_fixme_should_propagate_errors();

View file

@ -41,17 +41,17 @@ public:
virtual void event(Core::Event&) override;
void set_in(NonnullOwnPtr<Core::File> in)
ErrorOr<void> set_in(NonnullOwnPtr<Core::File> in)
{
m_in_fd = in->fd();
m_in = Core::BufferedFile::create(move(in)).release_value_but_fixme_should_propagate_errors();
m_in = TRY(Core::BufferedFile::create(move(in)));
set_in_notifier();
return {};
}
void set_out(NonnullOwnPtr<Core::File> out) { m_out = move(out); }
protected:
Endpoint() = default;
Endpoint(NonnullOwnPtr<Core::File> in, NonnullOwnPtr<Core::File> out);
virtual void custom_event(Core::CustomEvent&) override;
private: