@@ -1850,10 +1850,17 @@ AwaitableSubscribe Request::subscribe(RequestSubscribeParams params)
1850
1850
try
1851
1851
{
1852
1852
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
+ }
1857
1864
}
1858
1865
catch (const std::exception& ex)
1859
1866
{
@@ -1873,6 +1880,7 @@ AwaitableUnsubscribe Request::unsubscribe(RequestUnsubscribeParams params)
1873
1880
const auto spThis = shared_from_this ();
1874
1881
std::unique_lock lock { spThis->_subscriptionMutex };
1875
1882
const auto itrOperation = spThis->_operations .find (strSubscription);
1883
+ std::list<schema_error> errors {};
1876
1884
1877
1885
if (itrOperation != spThis->_operations .end ())
1878
1886
{
@@ -1892,16 +1900,22 @@ AwaitableUnsubscribe Request::unsubscribe(RequestUnsubscribeParams params)
1892
1900
lock.unlock ();
1893
1901
1894
1902
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 );
1899
1908
1900
1909
lock.lock ();
1901
1910
}
1902
1911
1903
1912
spThis->removeSubscription (params.key );
1904
1913
1914
+ if (!errors.empty ())
1915
+ {
1916
+ throw schema_exception { std::move (errors) };
1917
+ }
1918
+
1905
1919
co_return ;
1906
1920
}
1907
1921
0 commit comments