File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,31 @@ export async function pullDetailsModal({
5656 const pullRawData = await http . get (
5757 `https://api.github.com/repos/${ data ?. repository } /pulls/${ data ?. number } `
5858 ) ;
59+
60+ // If pullsNumber doesn't exist, notify the user
61+ if ( pullRawData . statusCode === 404 ) {
62+ block . addSectionBlock ( {
63+ text : {
64+ text : `Pull request #${ data ?. number } doesn't exist.` ,
65+ type : TextObjectType . PLAINTEXT ,
66+ } ,
67+ } ) ;
68+
69+ return {
70+ title : {
71+ type : TextObjectType . PLAINTEXT ,
72+ text : AppEnum . DEFAULT_TITLE ,
73+ } ,
74+ close : block . newButtonElement ( {
75+ text : {
76+ type : TextObjectType . PLAINTEXT ,
77+ text : "Close" ,
78+ } ,
79+ } ) ,
80+ blocks : block . getBlocks ( ) ,
81+ } ;
82+ }
83+
5984 const pullData = pullRawData . data ;
6085
6186 const pullRequestFilesRaw = await http . get (
You can’t perform that action at this time.
0 commit comments