Skip to content

Commit

Permalink
changes impl. custom logger to logger without extending Logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
cooffeeRequired committed Feb 1, 2025
1 parent 437f77c commit 66c76a8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions src/main/java/cz/coffeerequired/api/Extensible.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cz.coffeerequired.api;

import cz.coffeerequired.api.exceptions.ModulableException;
import cz.coffeerequired.api.exceptions.ExtensibleThrowable;
import lombok.Getter;

import java.util.ArrayList;
Expand Down Expand Up @@ -30,9 +30,9 @@ protected Extensible() {
this.skriptElementPath = "";
}

public void load() throws ModulableException {
public void load() throws ExtensibleThrowable {
if (this.sign.isEmpty() || this.skriptElementPath.isEmpty()) {
throw new ModulableException("Cannot invoke Skript registration for empty sign or elements packages");
throw new ExtensibleThrowable("Cannot invoke Skript registration for empty sign or elements packages");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cz/coffeerequired/api/Register.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import cz.coffeerequired.SkJson;
import cz.coffeerequired.api.annotators.ExternalAPI;
import cz.coffeerequired.api.annotators.Module;
import cz.coffeerequired.api.exceptions.ModulableException;
import cz.coffeerequired.api.exceptions.ExtensibleThrowable;
import cz.coffeerequired.modules.Core;
import cz.coffeerequired.modules.HttpModule;
import cz.coffeerequired.support.AnsiColorConverter;
Expand Down Expand Up @@ -120,7 +120,7 @@ public <T extends Extensible> void registerModule(Class<T> module) {
m.load();
m.registerElements(this.getSkriptRegister());
printAllRegistered(m);
} catch (ModulableException | InstantiationException | IllegalAccessException |
} catch (ExtensibleThrowable | InstantiationException | IllegalAccessException |
InvocationTargetException |
NoSuchMethodException e) {
SkJson.exception(e, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package cz.coffeerequired.api.exceptions;

public class ExtensibleThrowable extends RuntimeException {
public ExtensibleThrowable(String message) {
super(message);
}
}

This file was deleted.

30 changes: 15 additions & 15 deletions src/test/scripts/custom/caching.sk
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
test "json storage cache":
set {_json} to json from "{array: [{A: 1, B: 2, C: 3, location: {}}]}"

create json file "jsons/test.json" and write to it {_json} with configuration[replace=true, encoding=UTF-8]

create json virtual storage named "virtual"

set (json storage of id "virtual").new to "Test"

bind json file "jsons/test.json" as "test"

send json storage of id "virtual"
send json storage of id "test"

assert json storage of id "virtuals" is set with "cannot create virtual storage"
assert json storage of id "test" is set with "cannot create an cache from file"
# set {_json} to json from "{array: [{A: 1, B: 2, C: 3, location: {}}]}"
#
# create json file "jsons/test.json" and write to it {_json} with configuration[replace=true, encoding=UTF-8]
#
# create json virtual storage named "virtual"
#
# set (json storage of id "virtual").new to "Test"
#
# bind json file "jsons/test.json" as "test"
#
# send json storage of id "virtual"
# send json storage of id "test"
#
# assert json storage of id "virtuals" is set with "cannot create virtual storage"
# assert json storage of id "test" is set with "cannot create an cache from file"

0 comments on commit 66c76a8

Please # to comment.