mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Use double quotes for identifiers in error messages
This commit is contained in:
@@ -121,12 +121,12 @@ exports.hasData = attachment =>
|
||||
// IO (Promise Attachment)
|
||||
exports.loadData = (readAttachmentData) => {
|
||||
if (!isFunction(readAttachmentData)) {
|
||||
throw new TypeError('`readAttachmentData` must be a function');
|
||||
throw new TypeError('"readAttachmentData" must be a function');
|
||||
}
|
||||
|
||||
return async (attachment) => {
|
||||
if (!exports.isValid(attachment)) {
|
||||
throw new TypeError('`attachment` is not valid');
|
||||
throw new TypeError('"attachment" is not valid');
|
||||
}
|
||||
|
||||
const isAlreadyLoaded = exports.hasData(attachment);
|
||||
@@ -135,7 +135,7 @@ exports.loadData = (readAttachmentData) => {
|
||||
}
|
||||
|
||||
if (!isString(attachment.path)) {
|
||||
throw new TypeError('`attachment.path` is required');
|
||||
throw new TypeError('"attachment.path" is required');
|
||||
}
|
||||
|
||||
const data = await readAttachmentData(attachment.path);
|
||||
@@ -148,12 +148,12 @@ exports.loadData = (readAttachmentData) => {
|
||||
// IO Unit
|
||||
exports.deleteData = (deleteAttachmentData) => {
|
||||
if (!isFunction(deleteAttachmentData)) {
|
||||
throw new TypeError('`deleteAttachmentData` must be a function');
|
||||
throw new TypeError('"deleteAttachmentData" must be a function');
|
||||
}
|
||||
|
||||
return async (attachment) => {
|
||||
if (!exports.isValid(attachment)) {
|
||||
throw new TypeError('`attachment` is not valid');
|
||||
throw new TypeError('"attachment" is not valid');
|
||||
}
|
||||
|
||||
const hasDataInMemory = exports.hasData(attachment);
|
||||
@@ -162,7 +162,7 @@ exports.deleteData = (deleteAttachmentData) => {
|
||||
}
|
||||
|
||||
if (!isString(attachment.path)) {
|
||||
throw new TypeError('`attachment.path` is required');
|
||||
throw new TypeError('"attachment.path" is required');
|
||||
}
|
||||
|
||||
await deleteAttachmentData(attachment.path);
|
||||
|
||||
@@ -13,7 +13,7 @@ const omit = require('lodash/omit');
|
||||
// Promise Attachment
|
||||
exports.migrateDataToFileSystem = async (attachment, { writeAttachmentData } = {}) => {
|
||||
if (!isFunction(writeAttachmentData)) {
|
||||
throw new TypeError('`writeAttachmentData` must be a function');
|
||||
throw new TypeError('"writeAttachmentData" must be a function');
|
||||
}
|
||||
|
||||
const { data } = attachment;
|
||||
|
||||
@@ -81,10 +81,10 @@ exports.initializeSchemaVersion = (message) => {
|
||||
// SchemaVersion -> UpgradeStep -> UpgradeStep
|
||||
exports._withSchemaVersion = (schemaVersion, upgrade) => {
|
||||
if (!SchemaVersion.isValid(schemaVersion)) {
|
||||
throw new TypeError('`schemaVersion` is invalid');
|
||||
throw new TypeError('"schemaVersion" is invalid');
|
||||
}
|
||||
if (!isFunction(upgrade)) {
|
||||
throw new TypeError('`upgrade` must be a function');
|
||||
throw new TypeError('"upgrade" must be a function');
|
||||
}
|
||||
|
||||
return async (message, context) => {
|
||||
|
||||
Reference in New Issue
Block a user