mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
fix readonly error (#91104)
This commit is contained in:
parent
2ef468ef82
commit
7f1071149d
2 changed files with 10 additions and 0 deletions
|
@ -98,6 +98,12 @@ export class LensReportManager {
|
|||
this.write();
|
||||
} catch (e) {
|
||||
// Silent error because events will be reported during the next timer
|
||||
|
||||
// If posting stats is forbidden for the current user, stop attempting to send them,
|
||||
// but keep them in storage to push in case the user logs in with sufficient permissions at some point.
|
||||
if (e.response && e.response.status === 403) {
|
||||
this.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import Boom from '@hapi/boom';
|
|||
import { errors } from '@elastic/elasticsearch';
|
||||
import { CoreSetup } from 'src/core/server';
|
||||
import { schema } from '@kbn/config-schema';
|
||||
import { SavedObjectsErrorHelpers } from '../../../../../src/core/server';
|
||||
import { BASE_API_URL } from '../../common';
|
||||
import { PluginStartContract } from '../plugin';
|
||||
|
||||
|
@ -73,6 +74,9 @@ export async function initLensUsageRoute(setup: CoreSetup<PluginStartContract>)
|
|||
|
||||
return res.ok({ body: {} });
|
||||
} catch (e) {
|
||||
if (SavedObjectsErrorHelpers.isForbiddenError(e)) {
|
||||
return res.forbidden();
|
||||
}
|
||||
if (e instanceof errors.ResponseError && e.statusCode === 404) {
|
||||
return res.notFound();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue