FlickingError
class FlickingError extends Error
Special type of known error that Flicking throws.
PROPERTY | TYPE | DESCRIPTION |
---|---|---|
code | number | Error code |
message | string | Error message |
See:
constructor
new FlickingError(message, code)
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
message | string | Error message | ||
code | number | Error code |
import Flicking, { FlickingError, ERROR_CODES } from "@egjs/flicking";
try {
const flicking = new Flicking(".flicking-viewport")
} catch (e) {
if (e instanceof FlickingError && e.code === ERROR_CODES.ELEMENT_NOT_FOUND) {
console.error("Element not found")
}
}