diff --git a/application/MantisBT/Exception/Issue/Comment/CommentNotFound.php b/application/MantisBT/Exception/Issue/Comment/CommentNotFound.php new file mode 100644 index 0000000000..ec2f9ff578 --- /dev/null +++ b/application/MantisBT/Exception/Issue/Comment/CommentNotFound.php @@ -0,0 +1,14 @@ +responseCode = 400; + } +} diff --git a/application/core/bugnote_api.php b/application/core/bugnote_api.php index f138e035c3..506d8603fa 100644 --- a/application/core/bugnote_api.php +++ b/application/core/bugnote_api.php @@ -42,6 +42,7 @@ use MantisBT\Exception\Database\ColumnNotFound; use MantisBT\Exception\Field\EmptyField; +use MantisBT\Exception\Issue\Comment\CommentNotFound; require_api( 'access_api.php' ); require_api( 'authentication_api.php' ); @@ -107,7 +108,7 @@ function bugnote_exists( $p_bugnote_id ) { */ function bugnote_ensure_exists( $p_bugnote_id ) { if( !bugnote_exists( $p_bugnote_id ) ) { - trigger_error( ERROR_BUGNOTE_NOT_FOUND, ERROR ); + throw new CommentNotFound( $p_bugnote_id ); } }