0

We are trying to implement Yum support for one of our plugins developed for Sonatype Nexus Repository Manager (NRM). The users set up Yum Proxy in NRM to download and install the packages Eg: yum install <package>.

Our goal is to send back and display a custom message in user's Yum client when the user initiates installation. This custom message will be generated based on a specific criteria checked at the backend logic of the plugin.

However, the Yum client is displaying only the errorCode but not the custom message. Screenshot here..

We tried different errorCodes as well as the debuglevel option to see if it displays additional logs. But it was not successful. Is there an approach or a workaround to overcome this issue? Appreciate your thoughts and support on this. Thank you.

Below is how we are constructing the Response object from Nexus plugin:

@Singleton
public class MyConditionalRequestHandler extends ConditionalRequestHandler {
    @Override
    public Response handle(@Nonnull Context context) throws Exception {
        Builder builder = new Response.Builder();
        Response response = builder.status(new Status(true, "400", "Custom Message")).build();
        return response;
    }
}

Types:

  • org.sonatype.nexus.repository.view.handlers.ConditionalRequestHandler
  • org.sonatype.nexus.repository.view.Response
  • org.sonatype.nexus.repository.view.Status.Status(boolean successful, int code, @Nullable String message)
Zeitounator
  • 38,476
  • 7
  • 53
  • 66
Shihaaz
  • 1
  • 2
  • 1
    Are you sure yum has code to display the reason phrase sent with a response? Many build clients won’t do that in my experience. – rseddon Aug 31 '22 at 13:36
  • I am not sure about Yum. Is there a place where I can look at? Or is there a Yum specific forum where I can ask this question? We have implemented the same for go, maven, npm, pip, gem etc. and it works well (displays the reason phrase) without any issues. Want to know if Yum supports it and if so, is there anything that we are missing. :-) – Shihaaz Aug 31 '22 at 15:06

0 Answers0