Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #183 from book000/chore/add-debug-get-dest-vc
Browse files Browse the repository at this point in the history
chore: 移動先VCチャンネルチェック時の処理デバッグコード追加
  • Loading branch information
yuuahp authored Nov 21, 2022
2 parents e5b71bd + 8b1f7ad commit 2556d1a
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
Expand Down Expand Up @@ -100,7 +101,7 @@ private JSONArray getDestinationChannels(String userId) throws IOException {
try {
ProcessBuilder builder = new ProcessBuilder();
builder.command(List.of("node", "--no-warnings", LibFiles.VFile.EXTERNAL_SCRIPT_DESTINATION_CHANNEL.getPath().toString(), "--userId", userId));
builder.redirectErrorStream(true);
builder.redirectErrorStream(false);
builder.directory(new File("."));
p = builder.start();
boolean bool = p.waitFor(3, TimeUnit.MINUTES);
Expand All @@ -115,7 +116,13 @@ private JSONArray getDestinationChannels(String userId) throws IOException {
System.out.println(streamToString);
return null;
}
return new JSONArray(streamToString);
try {
return new JSONArray(streamToString);
} catch (JSONException e) {
System.out.println("JSON Error: " + e.getMessage());
System.out.println(streamToString);
return null;
}
} catch (InterruptedException e) {
e.printStackTrace();
return null;
Expand Down

0 comments on commit 2556d1a

Please sign in to comment.