catch the error in fetch method of view