mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
* Import API: Don't override SavedObjectClient errors * Review comments: rely on default hapi error behaviour
This commit is contained in:
parent
5192dac0b6
commit
f7568e6fbf
2 changed files with 5 additions and 10 deletions
|
@ -17,10 +17,11 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import { exportDashboards } from '../../../lib/export/export_dashboards';
|
||||
import Boom from 'boom';
|
||||
import Joi from 'joi';
|
||||
import moment from 'moment';
|
||||
|
||||
import { exportDashboards } from '../../../lib/export/export_dashboards';
|
||||
|
||||
export function exportApi(server) {
|
||||
server.route({
|
||||
path: '/api/kibana/dashboards/export',
|
||||
|
@ -46,8 +47,7 @@ export function exportApi(server) {
|
|||
.header('Content-Disposition', `attachment; filename="${filename}"`)
|
||||
.header('Content-Type', 'application/json')
|
||||
.header('Content-Length', Buffer.byteLength(json, 'utf8'));
|
||||
})
|
||||
.catch(err => Boom.boomify(err, { statusCode: 400 }));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import Boom from 'boom';
|
||||
import Joi from 'joi';
|
||||
import { importDashboards } from '../../../lib/import/import_dashboards';
|
||||
|
||||
|
@ -40,11 +39,7 @@ export function importApi(server) {
|
|||
},
|
||||
|
||||
handler: async (req) => {
|
||||
try {
|
||||
return await importDashboards(req);
|
||||
} catch (err) {
|
||||
throw Boom.boomify(err, { statusCode: 400 });
|
||||
}
|
||||
return await importDashboards(req);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue