-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connect upload component's error to message #163
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- νμΈνμ΅λλ€!
getErrorMessage(): string { | ||
const errorCode = this.response?.data?.errorCode; | ||
if (!errorCode) return ERROR_CODE.INTERNAL_SEVER_ERROR; | ||
return errorCode in ERROR_CODE ? ERROR_CODE[errorCode as keyof typeof ERROR_CODE] : errorCode; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Error κ°μ²΄μμ μλ¬ λ©μμ§ μ²λ¦¬νλ λ°©μ μ’λ€μ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ³ μνμ ¨μ΄γ μ©
}; | ||
} | ||
return await res.text(); | ||
return (await fetch(API_PATH.parsePDFtoText, { method: 'POST', body: formData })).text(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄κ±° text ν¨μ νμ μλλ‘ μμ νμ κ±° μλκ°μ©??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ν΄λΉ μμ²μ΄ PRμ μμ ν formdata μμ²μ λν μ€λ₯λ¬Έμ κ° λ°μν ν¨μμ
λλ€.
λ°λΌ fetch-axμ λ³κ²½μ¬νμ΄ μ
λ°μ΄νΈ λκΈ° μ κΉμ§, fetch-axλ‘ μ ννλ κ²μ λ―Έλ£¨κ³ fetchλ₯Ό κ·Έλλ‘ μ¬μ©νμ΅λλ€. ν΄λΉ μμ²μ μλ΅μ΄ textνμμΌλ‘ μ λ¬λλ―λ‘ text()
λ₯Ό ν΅ν΄ parsingμ μ§ννμ΅λλ€!
π μμ λ΄μ©
π€ κ³ λ―Ό νλ λΆλΆ
μ±μ μ λ‘λ νμ΄μ§μ error code λ°μ
errorCode && errorCode in ERROR_CODE
κ°false
μΈ κ²½μ°μλ errorCodeλ₯Ό κ·Έλλ‘ λ ΈμΆν©λλ€.INVALIDATED_GRADUATION_CATEGORY
,UNFITTED_GRADUATION_CATEGORY
κ²½μ°λ, κ²°κ³Ό λλ©μΈκ³Ό κ΄λ ¨λ μλ¬μ΄μ§λ§ μ¬μ©μμκ² λ ΈμΆ λ κ°λ₯μ±μ΄ μλ€κ³ νλ¨ν΄ μ μ©νμ§ μμμ΅λλ€.formdata μμ²μ λν μ€λ₯
undefined
λ‘ μ€μ ]μν©
parsePDFtoText
λformdata
λ₯Ό λ΄μ μμ²μ μ μ‘content-type
μmultipart/form-data
μΌλ‘ λ΄μμ μμ²νλ κ²½μ°, 500μλ¬λ₯Ό λ°ν-> λ°λΌμ fetch-axλ μλμΌλ‘ content-typeμ΄ μ€μ λλλ‘ μ λνκΈ° μν΄
formdata μμ²μ λν΄ content typeμ undefinedλ‘ μ€μ μ λ³κ²½ν κ³νμ λλ€.