-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Exception): add customized exception class
- Loading branch information
1 parent
c682c3a
commit 4cc6667
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...rk/boot/mediastreamingspringbootautoconfigure/exception/BadResourceLocationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.jmframework.boot.mediastreamingspringbootautoconfigure.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Description: BadResourceLocationException, Exception thrown when the video location is inaccessible or does not | ||
* exist. | ||
* | ||
* @author Johnny Miller (锺俊), email: [email protected] | ||
* date 10/19/2020 4:55 PM | ||
**/ | ||
@Slf4j | ||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) | ||
public class BadResourceLocationException extends RuntimeException { | ||
public BadResourceLocationException(String msg) { | ||
super(msg); | ||
log.error(msg); | ||
} | ||
|
||
public BadResourceLocationException(String msg, IOException ex) { | ||
super(msg, ex); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ramework/boot/mediastreamingspringbootautoconfigure/exception/VideoNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.jmframework.boot.mediastreamingspringbootautoconfigure.exception; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
|
||
import java.io.FileNotFoundException; | ||
|
||
/** | ||
* Description: BadResourceLocationException, Exception thrown when the video location is inaccessible or does not | ||
* exist. | ||
* | ||
* @author Johnny Miller (锺俊), email: [email protected] | ||
* date 10/19/2020 4:56 PM | ||
**/ | ||
@ResponseStatus(HttpStatus.NOT_FOUND) | ||
public class VideoNotFoundException extends FileNotFoundException { | ||
public VideoNotFoundException() { | ||
super("video was not found"); | ||
} | ||
} |