Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github token documentation url to initiliaze method exception in … #269

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
import javax.inject.Inject;

import org.ndx.aadarchi.base.OutputBuilder;
import org.ndx.aadarchi.base.ViewEnhancer;
import org.ndx.aadarchi.base.ehancers.ViewEnhancerAdapter;

import com.structurizr.Workspace;
import org.ndx.aadarchi.base.enhancers.ViewEnhancerAdapter;

import com.structurizr.view.ComponentView;
import com.structurizr.view.ContainerView;
import com.structurizr.view.View;
import com.structurizr.view.ViewSet;

public class ViewUpdater extends ViewEnhancerAdapter {
@Inject Logger logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import static org.ndx.aadarchi.github.Constants.CONFIG_GITHUB_TOKEN;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
Expand All @@ -18,9 +20,12 @@
*/
public class GitHubProducer {

public @Produces @ApplicationScoped GitHub initialize(@ConfigProperty(name=CONFIG_GITHUB_TOKEN) String token) {
public @Produces @ApplicationScoped GitHub initialize(@ConfigProperty(name=CONFIG_GITHUB_TOKEN) String token) throws MalformedURLException {
if(token==null || token.isBlank()) {
throw new GitHubHandlerException(String.format("Can't connect to GitHub if token %s isn't defined as system property", Constants.CONFIG_GITHUB_TOKEN));
URL githubTokenDoc = new URL("https://github.com/Riduidel/aadarchi/wiki/How-to-add-aadarchi.github.token%3F");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Un objet URL est utile quand on veut faire du flux dessus. Là ça n'est pas le cas, donc pas la peine de créer l'objet

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changement effectué. L'url est directement intégré dans le message de l'exception.

throw new GitHubHandlerException(String.format("Can't connect to GitHub if token %s isn't defined as system property" +
"\nSee %s for details",
Constants.CONFIG_GITHUB_TOKEN, githubTokenDoc));
}
try {
return new GitHubBuilder().withOAuthToken(token).build();
Expand Down