mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Improved logs for slow get helper
no issue - Updated the logs to show something more useful - controller name, instead of current [object Ojbect] appearing in the log
This commit is contained in:
parent
c701293514
commit
cb68257952
1 changed files with 3 additions and 2 deletions
|
@ -140,7 +140,8 @@ get = function get(resource, options) {
|
|||
return Promise.resolve(options.inverse(self, {data: data}));
|
||||
}
|
||||
|
||||
const controller = api[apiVersion][RESOURCES[resource].alias];
|
||||
const controllerName = RESOURCES[resource].alias;
|
||||
const controller = api[apiVersion][controllerName];
|
||||
const action = isBrowse(apiOptions) ? 'browse' : 'read';
|
||||
|
||||
// Parse the options we're going to pass to the API
|
||||
|
@ -179,7 +180,7 @@ get = function get(resource, options) {
|
|||
message: `{{#get}} helper took ${totalMs}ms to complete`,
|
||||
code: 'SLOW_GET_HELPER',
|
||||
errorDetails: {
|
||||
api: `${apiVersion}.${controller}.${action}`,
|
||||
api: `${apiVersion}.${controllerName}.${action}`,
|
||||
apiOptions,
|
||||
returnedRows: returnedRowsCount
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue