fix: snippet not found throw
This commit is contained in:
@@ -58,7 +58,7 @@ export class ServerlessController {
|
||||
})
|
||||
|
||||
if (!snippet) {
|
||||
throw new NotFoundException('snippet is not found')
|
||||
throw new NotFoundException('serverless function is not exist')
|
||||
}
|
||||
|
||||
if (snippet.private && !isMaster) {
|
||||
|
||||
@@ -99,6 +99,9 @@ export class SnippetService {
|
||||
*/
|
||||
async getSnippetByName(name: string, reference: string) {
|
||||
const doc = await this.model.findOne({ name, reference }).lean()
|
||||
if (!doc) {
|
||||
throw new NotFoundException('snippet is not found')
|
||||
}
|
||||
return doc
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user