Skip to content

Changed deploy from url error message #219

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion commands/deploy_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,27 @@ func (c *DeployCommand) doUploadFromUrl(encodedFileUrl string, mtaClient mtaclie
}
file = jobResult.File
if len(jobResult.Error) != 0 {
ui.Failed("Async upload job failed: %s", jobResult.Error)
var fileUrlWithoutCredentials string

decodedBytes, err := base64.URLEncoding.DecodeString(encodedFileUrl)
if err != nil {
fmt.Println("Error decoding:", err)
fileUrlWithoutCredentials = "an unknown url"
} else {
decodedURL := string(decodedBytes)

parsedURL, err := url.Parse(decodedURL)
if err != nil {
fmt.Println("Error parsing URL:", err)
fileUrlWithoutCredentials = "an unknown url"
} else {
parsedURL.User = nil
fileUrlWithoutCredentials = parsedURL.String()
}
}

ui.Failed("Async upload job failed: Credentials to %s are wrong. Make sure that they are correct.", fileUrlWithoutCredentials)

return UploadFromUrlStatus{
FileId: "",
MtaId: "",
Expand Down
Loading