@@ -1850,10 +1850,17 @@ AwaitableSubscribe Request::subscribe(RequestSubscribeParams params)
18501850 try
18511851 {
18521852 co_await launch;
1853- co_await operation->resolve (selectionSetParams,
1854- registration->selection ,
1855- registration->data ->fragments ,
1856- registration->data ->variables );
1853+
1854+ auto errors = std::move ((co_await operation->resolve (selectionSetParams,
1855+ registration->selection ,
1856+ registration->data ->fragments ,
1857+ registration->data ->variables ))
1858+ .errors );
1859+
1860+ if (!errors.empty ())
1861+ {
1862+ throw schema_exception { std::move (errors) };
1863+ }
18571864 }
18581865 catch (const std::exception& ex)
18591866 {
@@ -1873,6 +1880,7 @@ AwaitableUnsubscribe Request::unsubscribe(RequestUnsubscribeParams params)
18731880 const auto spThis = shared_from_this ();
18741881 std::unique_lock lock { spThis->_subscriptionMutex };
18751882 const auto itrOperation = spThis->_operations .find (strSubscription);
1883+ std::list<schema_error> errors {};
18761884
18771885 if (itrOperation != spThis->_operations .end ())
18781886 {
@@ -1892,16 +1900,22 @@ AwaitableUnsubscribe Request::unsubscribe(RequestUnsubscribeParams params)
18921900 lock.unlock ();
18931901
18941902 co_await params.launch ;
1895- co_await operation->resolve (selectionSetParams,
1896- registration->selection ,
1897- registration->data ->fragments ,
1898- registration->data ->variables );
1903+ errors = std::move ((co_await operation->resolve (selectionSetParams,
1904+ registration->selection ,
1905+ registration->data ->fragments ,
1906+ registration->data ->variables ))
1907+ .errors );
18991908
19001909 lock.lock ();
19011910 }
19021911
19031912 spThis->removeSubscription (params.key );
19041913
1914+ if (!errors.empty ())
1915+ {
1916+ throw schema_exception { std::move (errors) };
1917+ }
1918+
19051919 co_return ;
19061920}
19071921
0 commit comments