essential-actions

Clone or download

Twitch - add-stream-marker - Updated to work with latest Action API

Modified Files

--- 'a/twitch/add-stream-marker/src/main/java/addstreammarker/AddStreamMarkerAction.java'
+++ b/twitch/add-stream-marker/src/main/java/addstreammarker/AddStreamMarkerAction.java
@@ -5,6 +5,7 @@ import com.gikk.twirk.TwirkBuilder;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.externalplugin.NormalAction;
+import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.StreamPiException;
import com.stream_pi.util.version.Version;
import connect.chat.TwitchChatCredentials;
@@ -28,7 +29,7 @@ public class AddStreamMarkerAction exten
}
@Override
- public void initProperties() throws Exception
+ public void initProperties() throws MinorException
{
Property channelName = new Property(channelNameKey, Type.STRING);
channelName.setDisplayName("Channel Name");
@@ -42,13 +43,7 @@ public class AddStreamMarkerAction exten
}
@Override
- public void initAction() throws Exception
- {
-
- }
-
- @Override
- public void onActionClicked() throws Exception
+ public void onActionClicked() throws MinorException
{
final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials();
credentials.ensureCredentialsInitialized();
@@ -68,21 +63,23 @@ public class AddStreamMarkerAction exten
}
} catch (Exception ex)
{
- throw new StreamPiException(
- "Failed to add marker to stream", "Could not add stream marker, please try again."
+ throw new MinorException(
+ "Failed to add marker to stream\nCould not add stream marker, please try again."
);
}
}
@Override
- public void onShutDown() throws Exception
+ public void onShutDown() throws MinorException
{
if (twirk != null) {
try
{
twirk.disconnect();
- } catch (Exception ex) {
- throw new StreamPiException("Twitch connection error", "Please try again.");
+ }
+ catch (Exception ex)
+ {
+ throw new MinorException("Twitch connection error - Please try again.");
}
}
}