File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed
sdk/tables/azure-data-tables/src
main/java/com/azure/data/tables/implementation
test/java/com/azure/data/tables Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ public static <T> Response<T> callWithOptionalTimeout(Supplier<Response<T>> call
344344 ClientLogger logger , boolean skip409Logging ) {
345345 try {
346346 return callHandler (callable , timeout , logger );
347- } catch (Throwable thrown ) {
347+ } catch (Exception thrown ) {
348348 Throwable exception = mapThrowableToTableServiceException (thrown );
349349 if (exception instanceof TableServiceException ) {
350350 TableServiceException e = (TableServiceException ) exception ;
Original file line number Diff line number Diff line change 1717import com .azure .core .test .utils .MockTokenCredential ;
1818import com .azure .core .util .ClientOptions ;
1919import com .azure .core .util .Header ;
20+ import com .azure .core .util .logging .ClientLogger ;
21+ import com .azure .data .tables .implementation .TableUtils ;
2022import org .junit .jupiter .api .BeforeEach ;
2123import org .junit .jupiter .api .Test ;
2224import reactor .core .publisher .Mono ;
@@ -269,6 +271,15 @@ public void multipleFormsOfAuthenticationPresent() {
269271 .buildAsyncClient ());
270272 }
271273
274+ @ Test
275+ void nonRuntimeExceptionsDontGetCasted () {
276+ assertThrows (Error .class , () -> {
277+ TableUtils .callWithOptionalTimeout (() -> {
278+ throw new NoClassDefFoundError ("This is an error" );
279+ }, null , new ClientLogger (TableClientTest .class ));
280+ });
281+ }
282+
272283 @ Test
273284 public void bothRetryOptionsAndRetryPolicyPresent () {
274285 assertThrows (IllegalStateException .class ,
Original file line number Diff line number Diff line change 4747import java .util .Map ;
4848import java .util .UUID ;
4949
50- import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
51- import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
52- import static org .junit .jupiter .api .Assertions .assertEquals ;
53- import static org .junit .jupiter .api .Assertions .assertNotNull ;
54- import static org .junit .jupiter .api .Assertions .assertNull ;
55- import static org .junit .jupiter .api .Assertions .assertTrue ;
56- import static org .junit .jupiter .api .Assertions .fail ;
50+ import static org .junit .jupiter .api .Assertions .*;
5751
5852/**
5953 * Tests {@link TableClient}.
You can’t perform that action at this time.
0 commit comments