Skip to content
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

Update GetImageBlob/GetImagesBlob to return blob when ExceptionInfo i… #328

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

kfxhjz
Copy link

@kfxhjz kfxhjz commented Sep 23, 2024

…s warning kind

@justinfx
Copy link
Member

I didn't realize MagickGetImageBlob could report warnings. Are we just leaving that up to the caller to determine if the error is a warning?

@kfxhjz
Copy link
Author

kfxhjz commented Sep 24, 2024

Yes,So we need return blob data first.

outImgBlob, err := mw.GetImagesBlob()
if err != nil {
	// return res, fmt.Errorf("GetImagesBlob fail: %w", err)
	
	var exInfo *imagick.ExceptionInfo
	if errors.As(err, &exInfo) && exInfo.IsErrorKind() {
		return res, fmt.Errorf("GetImagesBlob fail: %w", err)
	}
	log.Warn().Err(err).Msg("GetImagesBlob fail")
}

@justinfx justinfx merged commit 9653766 into gographics:im-7 Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants