import { IRouter } from '../../http' ; import { SavedObjectsErrorHelpers } from '../../saved_objects' ; export function registerGetRoute ( router ) { router . get ( { path : '/api/kibana/settings' , validate : false } , async ( context , request , response ) => { try { const uiSettingsClient = context . core . uiSettings . client ; return response . ok ( { body : { settings : await uiSettingsClient . getUserProvided ( ) , } , } ) ; } catch ( error ) { if ( SavedObjectsErrorHelpers . isSavedObjectsClientError ( error ) ) { return response . customError ( { body : error , statusCode : error . output . statusCode , } ) ; } throw error ; } } ) ; }