Ionic librabry not returning error properly
private isError(data: PositionError | Geoposition): data is PositionError {
return ((data as PositionError).code !== undefined);
}
private $watchPosition(options: GeolocationOptions): Observable<Geoposition> {
return this.geolocation.watchPosition(options)
.do((position) => {
if (this.isError(position)) {
throw new PositionError();
}
});
}