{"record":{"id":"d4b9c99bca95a3e5","repo":"RocketChat/Rocket.Chat","slug":"custom-sound-error-invalid-sound","errorCode":"Custom_Sound_Error_Invalid_Sound","errorMessage":"Invalid sound","messagePattern":"Invalid sound","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/media/custom-sounds/lib/deleteCustomSound.ts","lineNumber":11,"sourceCode":"import { api } from '@rocket.chat/core-services';\nimport { CustomSounds } from '@rocket.chat/models';\nimport { Meteor } from 'meteor/meteor';\n\nimport { RocketChatFileCustomSoundsInstance } from '../startup/custom-sounds';\n\nexport const deleteCustomSound = async (_id: string): Promise<void> => {\n\tconst sound = await CustomSounds.findOneById(_id);\n\n\tif (!sound) {\n\t\tthrow new Meteor.Error('Custom_Sound_Error_Invalid_Sound', 'Invalid sound', {\n\t\t\tmethod: 'deleteCustomSound',\n\t\t});\n\t}\n\n\tawait RocketChatFileCustomSoundsInstance.deleteFile(`${sound._id}.${sound.extension}`);\n\tawait CustomSounds.removeById(_id);\n\n\tvoid api.broadcast('notify.deleteCustomSound', { soundData: sound });\n};\n","sourceCodeStart":1,"sourceCodeEnd":21,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/custom-sounds/lib/deleteCustomSound.ts#L1-L21","documentation":"Error \"Invalid sound\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/lib/media/custom-sounds/lib/deleteCustomSound.ts:11 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the _id of an existing custom sound to deleteCustomSound; the sound was not found in the CustomSounds collection.","Refresh the custom sound list and retry deletion with a valid sound id."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}