NetworkCallError Class

  • java.lang.Object
    • com.azure.core.test.models.NetworkCallError

public class NetworkCallError

This class represents a caught throwable during a network call. It is used to serialize exceptions that were thrown during the pipeline and deserialize them back into their actual throwable class when running in playback mode.

Constructor Summary

Constructor Description
NetworkCallError()

Empty constructor used by deserialization.

NetworkCallError(Throwable throwable)

Constructs the class setting the throwable and its class name.

Method Summary

Modifier and Type Method and Description
Throwable get()
void setClassName(String className)

Sets the name of the class of the throwable.

void setErrorMessage(String errorMessage)

Sets the error message of the class of the throwable.

void setThrowable(Throwable throwable)

Sets the throwable that was thrown during a network call.

Methods inherited from java.lang.Object

Constructor Details

NetworkCallError

public NetworkCallError()

Empty constructor used by deserialization.

NetworkCallError

public NetworkCallError(Throwable throwable)

Constructs the class setting the throwable and its class name.

Parameters:

throwable - Throwable thrown during a network call.

Method Details

get

public Throwable get()

Returns:

the thrown throwable as the class it was thrown as by converting is using its class name.

setClassName

public void setClassName(String className)

Sets the name of the class of the throwable. This is used during deserialization the construct the throwable as the actual class that was thrown.

Parameters:

className - Class name of the throwable.

setErrorMessage

public void setErrorMessage(String errorMessage)

Sets the error message of the class of the throwable. This is used during deserialization the construct the throwable as the actual class that was thrown.

Parameters:

errorMessage - Error msg from the exception.

setThrowable

public void setThrowable(Throwable throwable)

Sets the throwable that was thrown during a network call.

Parameters:

throwable - Throwable that was thrown.

Applies to