10
10
import me .chanjar .weixin .common .util .json .WxGsonBuilder ;
11
11
import me .chanjar .weixin .mp .api .WxMpMaterialService ;
12
12
import me .chanjar .weixin .mp .api .WxMpService ;
13
- import me .chanjar .weixin .mp .bean .WxMpMaterial ;
14
- import me .chanjar .weixin .mp .bean .WxMpMaterialArticleUpdate ;
15
- import me .chanjar .weixin .mp .bean .WxMpMaterialNews ;
16
- import me .chanjar .weixin .mp .bean .result .*;
13
+ import me .chanjar .weixin .mp .bean .material . WxMpMaterial ;
14
+ import me .chanjar .weixin .mp .bean .material . WxMpMaterialArticleUpdate ;
15
+ import me .chanjar .weixin .mp .bean .material . WxMpMaterialNews ;
16
+ import me .chanjar .weixin .mp .bean .material .*;
17
17
import me .chanjar .weixin .mp .util .http .*;
18
18
import me .chanjar .weixin .mp .util .json .WxMpGsonBuilder ;
19
19
@@ -37,8 +37,13 @@ public WxMpMaterialServiceImpl(WxMpService wxMpService) {
37
37
}
38
38
39
39
@ Override
40
- public WxMediaUploadResult mediaUpload (String mediaType , String fileType , InputStream inputStream ) throws WxErrorException , IOException {
41
- return this .mediaUpload (mediaType , FileUtils .createTmpFile (inputStream , UUID .randomUUID ().toString (), fileType ));
40
+ public WxMediaUploadResult mediaUpload (String mediaType , String fileType , InputStream inputStream ) throws WxErrorException {
41
+ try {
42
+ return this .mediaUpload (mediaType , FileUtils .createTmpFile (inputStream , UUID .randomUUID ().toString (), fileType ));
43
+ } catch (IOException e ) {
44
+ e .printStackTrace ();
45
+ throw new WxErrorException (WxError .newBuilder ().setErrorMsg (e .getMessage ()).build ());
46
+ }
42
47
}
43
48
44
49
@ Override
0 commit comments