Skip to content

Commit

Permalink
feat(Exception): add customized exception class
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymillergh committed Oct 19, 2020
1 parent c682c3a commit 4cc6667
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
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);
}
}
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");
}
}

0 comments on commit 4cc6667

Please sign in to comment.