Skip to content

Commit 7690cff

Browse files
authored
feat: New error message format (#129)
* fix(ludo): Set stage width and height * test(ludo): Remove unnecessary focus * fix(framework): Improve error message format * docs(framework): Adjust error message format
1 parent a94c8db commit 7690cff

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ A list of all possible error codes can be found [here](ERROR_CODES.md).
163163
### 1. The framework throws an exception when doing something
164164
All exceptions thrown by the framework are listed in the [error code documentation](ERROR_CODES.md).
165165
When the framework throws an exception, it will print the error code and a short description of the error to the console.
166-
If for example the error `java.lang.IllegalArgumentException: Class '*' is not a component. [FFX1000]` is thrown, you can
167-
check the error code documentation for [FFX1000](ERROR_CODES.md#1000-class--is-not-a-component) to find out what the error
168-
means and how to fix it.
166+
If for example the error `java.lang.IllegalArgumentException: FFX1000: Class '*' is not a component.` is thrown, you can check the error code documentation for [FFX1000](ERROR_CODES.md#1000-class--is-not-a-component) to find out what the error means and how to fix it.
169167

170168
### 2. My route is not found even though it is registered
171169
When using `show("route/to/controller")` without a leading "`/`", the route is relative to the currently displayed controller.

framework/src/main/java/org/fulib/fx/util/FrameworkUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private FrameworkUtil() {
1919
}
2020

2121
public static String error(int id) {
22-
return ERROR_BUNDLE.getString(String.valueOf(id)) + " [FFX" + id + "]";
22+
return "FFX" + id + ": " + ERROR_BUNDLE.getString(String.valueOf(id));
2323
}
2424

2525
public static String note(int id) {

ludo/src/main/java/de/uniks/ludo/App.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public void start(Stage primaryStage) {
3939
// Setting the default resource bundle of the application to the resource bundle provided by the component
4040
setDefaultResourceBundle(component.bundle());
4141

42+
primaryStage.setWidth(1200);
43+
primaryStage.setHeight(800);
44+
4245
// Adding a key event handler to the stage, which listens for the F5 key to refresh the application
4346
stage().addEventHandler(KEY_RELEASED, event -> {
4447
if (event.getCode() == KeyCode.F5) {

ludo/src/test/java/de/uniks/ludo/AppTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public void start(Stage stage) throws Exception {
2929

3030
@Test
3131
public void test() {
32-
Platform.runLater(() -> app.stage().requestFocus());
33-
waitForFxEvents();
34-
3532
press(KeyCode.LEFT);
3633
release(KeyCode.LEFT);
3734
press(KeyCode.TAB);

0 commit comments

Comments
 (0)