File tree 4 files changed +45
-6
lines changed
4 files changed +45
-6
lines changed Original file line number Diff line number Diff line change 4
4
workflow_dispatch :
5
5
inputs :
6
6
tag :
7
+ description : tag
7
8
required : true
8
9
9
10
run-name : Native Images ${{ inputs.tag }} by @${{ github.actor }}
Original file line number Diff line number Diff line change 14
14
</properties >
15
15
16
16
<artifactId >umlet</artifactId >
17
+ <name >umlet-cli</name >
17
18
18
19
<dependencies >
19
20
<dependency >
20
21
<groupId >com.umlet</groupId >
21
22
<artifactId >umlet-mini</artifactId >
22
23
<version >${project.version} </version >
23
24
</dependency >
25
+ <dependency >
26
+ <groupId >org.slf4j</groupId >
27
+ <artifactId >slf4j-api</artifactId >
28
+ <version >2.0.7</version >
29
+ </dependency >
30
+ <dependency >
31
+ <groupId >ch.qos.logback</groupId >
32
+ <artifactId >logback-classic</artifactId >
33
+ <version >1.4.7</version >
34
+ </dependency >
24
35
</dependencies >
25
36
26
37
<build >
Original file line number Diff line number Diff line change 6
6
import com .baselet .control .util .Utils ;
7
7
import com .baselet .diagram .DiagramHandler ;
8
8
import com .baselet .diagram .io .OutputHandler ;
9
+ import org .xml .sax .SAXParseException ;
9
10
10
11
import java .io .BufferedReader ;
11
12
import java .io .ByteArrayOutputStream ;
@@ -22,11 +23,20 @@ public class UmletConverter {
22
23
}
23
24
24
25
public static byte [] convert (String source , String outputFormat ) throws Exception {
25
- DiagramHandler handler = DiagramHandler .forExport (source );
26
- ByteArrayOutputStream baos = new ByteArrayOutputStream ();
27
- OutputHandler .createToStream (outputFormat , baos , handler );
28
- byte [] result = baos .toByteArray ();
29
- handler .close ();
30
- return result ;
26
+ try {
27
+ DiagramHandler handler = DiagramHandler .forExport (source );
28
+ ByteArrayOutputStream baos = new ByteArrayOutputStream ();
29
+ OutputHandler .createToStream (outputFormat , baos , handler );
30
+ byte [] result = baos .toByteArray ();
31
+ handler .close ();
32
+ return result ;
33
+ } catch (Exception e ) {
34
+ if (e instanceof RuntimeException && e .getCause () instanceof SAXParseException ) {
35
+ // gives a better error message when handling invalid XML
36
+ // https://github.com/yuzutech/kroki/issues/1556
37
+ throw new IllegalArgumentException (e .getCause ().getMessage ());
38
+ }
39
+ throw e ;
40
+ }
31
41
}
32
42
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!DOCTYPE configuration >
3
+
4
+ <configuration >
5
+ <import class =" ch.qos.logback.classic.encoder.PatternLayoutEncoder" />
6
+ <import class =" ch.qos.logback.core.ConsoleAppender" />
7
+
8
+ <appender name =" STDOUT" class =" ConsoleAppender" >
9
+ <encoder class =" PatternLayoutEncoder" >
10
+ <pattern >%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%kvp- %msg%n</pattern >
11
+ </encoder >
12
+ </appender >
13
+
14
+ <root level =" WARN" >
15
+ <appender-ref ref =" STDOUT" />
16
+ </root >
17
+ </configuration >
You can’t perform that action at this time.
0 commit comments