Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2020 г..
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Интерфейс PositionError представляет причину ошибки, возникающую при использовании устройства геолокации.
Интерфейс PositionError не наследует никаких свойств.
PositionError.code Только для чтения Secure contextВозвращает unsigned short, представляющий код ошибки. Возможны следующие значения:
| 1 | PERMISSION_DENIED | Не удалось получить информацию о геолокации, поскольку у страницы не было разрешения на это. |
| 2 | POSITION_UNAVAILABLE | Не удалось получить геолокацию, поскольку по крайней мере один внутренний источник позиции вернул внутреннюю ошибку. |
| 3 | TIMEOUT | Время, разрешённое для получения геолокации, определяется PositionOptions.timeout информация была достигнута до получения информации. |
Returns a human-readable DOMString describing the details of the error. Specifications note that this is primarily intended for debugging use and not to be shown directly in a user interface.
The PositionError interface neither implements nor inherits any method.
| Geolocation # position_error_interface |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 24 июн. 2025 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.