Tabnine Logo
RestLiServiceException.hasErrorDetails
Code IndexAdd Tabnine to your IDE (free)

How to use
hasErrorDetails
method
in
com.linkedin.restli.server.RestLiServiceException

Best Java code snippets using com.linkedin.restli.server.RestLiServiceException.hasErrorDetails (Showing top 2 results out of 315)

origin: apache/incubator-gobblin

@Test
public void test() throws Exception {
 try(Closer closer = Closer.create()) {
  Map<String, String> configMap = Maps.newHashMap();
  TestingServer zkTestingServer = closer.register(new TestingServer(-1));
  configMap.put(ThrottlingGuiceServletConfig.ZK_STRING_KEY, zkTestingServer.getConnectString());
  configMap.put(ThrottlingGuiceServletConfig.HA_CLUSTER_NAME, TestFailover.class.getSimpleName() + "_cluster");
  Config config = ConfigFactory.parseMap(configMap);
  ThrottlingGuiceServletConfig server2001 = createServerAtPort(config, 2001);
  PermitAllocation allocation = sendRequestToServer(server2001, 10);
  Assert.assertTrue(allocation.getPermits() >= 1);
  ThrottlingGuiceServletConfig server2002 = createServerAtPort(config, 2002);
  allocation = sendRequestToServer(server2001, 10);
  Assert.assertTrue(allocation.getPermits() >= 1);
  try {
   sendRequestToServer(server2002, 10);
   Assert.fail();
  } catch (RestLiServiceException exc) {
   Assert.assertTrue(exc.hasErrorDetails());
   Assert.assertTrue(exc.getErrorDetails().containsKey(LimiterServerResource.LOCATION_301));
   Assert.assertEquals(new URI(exc.getErrorDetails().get(LimiterServerResource.LOCATION_301).toString()).getPort(), 2001);
  }
  server2001.close();
  allocation = sendRequestToServer(server2002, 10);
  Assert.assertTrue(allocation.getPermits() >= 1);
 }
}
origin: com.linkedin.pegasus/restli-server

if (errorResponseFormat.showDetails() && result.hasErrorDetails())
com.linkedin.restli.serverRestLiServiceExceptionhasErrorDetails

Popular methods of RestLiServiceException

  • <init>
  • getStatus
  • setErrorDetails
  • getErrorDetails
  • getMessage
  • fromThrowable
  • getLocalizedMessage
  • getOverridingFormat
  • getServiceErrorCode
  • hasOverridingErrorResponseFormat
    Returns whether this exception has an overriding error format.
  • hasServiceErrorCode
  • printStackTrace
  • hasServiceErrorCode,
  • printStackTrace,
  • setServiceErrorCode

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • Menu (java.awt)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now