SylarLong / iztro

⭐A lightweight open-source JavaScript library for obtaining The Purple Star Astrology (Zi Wei Dou Shu) astrolabe information.. 支持多语言轻量级获取紫微斗数排盘信息的javascript开源库。
https://iztro.com
MIT License
1.93k stars 252 forks source link

v2.4.2: Select February 30th of the lunar year causes `Unexpected Application Error!` #194

Open LucasJi opened 4 months ago

LucasJi commented 4 months ago

描述(Description)

Just as the title says, when selecting Feb 30, the online astrolabe shows an error page. image

I would appreciate it if the author could add exception handling. This would make not only this library but also the React hook iztro-hook more flexible for other developers in resolving exceptions.

版本(Version)

重现(Reproduce)

lunar2solar

1997-2-30(Lunar)

Unexpected Application Error!
only 29 days in lunar year 1997 month 2
Error: only 29 days in lunar year 1997 month 2
    at zr.fromYmdHms (https://ziwei.pub/assets/main-9b6d5ef5.js:531:433671)
    at zr.fromYmd (https://ziwei.pub/assets/main-9b6d5ef5.js:531:433418)
    at a (https://ziwei.pub/assets/main-9b6d5ef5.js:531:471599)
    at S (https://ziwei.pub/assets/main-9b6d5ef5.js:531:490662)
    at Object.w (https://ziwei.pub/assets/main-9b6d5ef5.js:531:490919)
    at https://ziwei.pub/assets/main-9b6d5ef5.js:531:545457
    at Ax (https://ziwei.pub/assets/main-9b6d5ef5.js:40:24296)
    at ih (https://ziwei.pub/assets/main-9b6d5ef5.js:40:42448)
    at JV (https://ziwei.pub/assets/main-9b6d5ef5.js:40:34557)
    at E (https://ziwei.pub/assets/main-9b6d5ef5.js:25:1540)
SylarLong commented 4 months ago

@LucasJi thank you for reporting. I'll catch the exception soon.