KocproZ / jenkins-discord

A post-build plugin that sends the build status to a Discord channel.
MIT License
39 stars 36 forks source link

Exception with Embedded Descriptions #44

Closed deathlyrage closed 5 years ago

deathlyrage commented 5 years ago

When using discord notifier with plastic SCM plugin when there are changes example:

  1. [cs:611@Name@Name@cloud]

The discord plugin crashes with the following exception:

java.lang.NullPointerException at nz.co.jammehcow.jenkinsdiscord.util.EmbedDescription.<init>(EmbedDescription.java:35) at nz.co.jammehcow.jenkinsdiscord.WebhookPublisher.perform(WebhookPublisher.java:134) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.cleanUp(Build.java:196) at hudson.model.Run.execute(Run.java:1866) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)

Note: I tried to post this on the new github repo on jenkinssci but there was no issues section :(

KocproZ commented 5 years ago

Sorry for the lack of issue section there, I forgot to turn them on. Please install this version of the plugin and let me know if it works.

deathlyrage commented 5 years ago

I updated the plugin with the one you linked. I now get this exception

java.lang.StringIndexOutOfBoundsException: String index out of range: 6 at java.lang.String.substring(Unknown Source) at nz.co.jammehcow.jenkinsdiscord.util.EmbedDescription.<init>(EmbedDescription.java:37) at nz.co.jammehcow.jenkinsdiscord.WebhookPublisher.perform(WebhookPublisher.java:142) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.cleanUp(Build.java:196) at hudson.model.Run.execute(Run.java:1866) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'Discord Notifier' marked build as failure

KocproZ commented 5 years ago

A fixed version, should work now.

deathlyrage commented 5 years ago

It looks like that fixed version no longer crashes so far. Thanks!