File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
core/src/main/java/org/botblock/javabotblockapi/core Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public Builder(){}
8383 * <p>Following Exceptions can be thrown from the {@link org.botblock.javabotblockapi.core.CheckUtil CheckUtil}:
8484 * <ul>
8585 * <li>{@link java.lang.NullPointerException NullPointerException} - When the provided Token is empty.</li>
86+ * <li>{@link java.lang.IllegalStateException IllegalStateException} - When the provided Site doesn't support POST requests.</li>
8687 * </ul>
8788 *
8889 * @return The Builder after the site and token were set. Useful for chaining.
@@ -91,16 +92,7 @@ public Builder(){}
9192 */
9293 public Builder addAuthToken (@ Nonnull Site site , @ Nonnull String token ){
9394 CheckUtil .notEmpty (token , "Token" );
94-
95- Field field ;
96- try {
97- field = site .getClass ().getField (site .name ());
98- }catch (NoSuchFieldException ex ){
99- field = null ;
100- }
101-
102- if (field == null || !field .isAnnotationPresent (Post .class ))
103- throw new IllegalStateException ("The provided Site instance is not allowed for POST Actions!" );
95+ CheckUtil .supportsPost (site );
10496
10597 tokens .put (site .getSite (), token );
10698 return this ;
You can’t perform that action at this time.
0 commit comments