{"record":{"id":"8540fe7f223ef3a9","repo":"googleapis/mcp-toolbox","slug":"destination-q-w","errorCode":null,"errorMessage":"destination %q: %w","messagePattern":"destination %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/cloudstorage/cloudstorage.go","lineNumber":436,"sourceCode":"\tif err := s.validateLocalPath(destination); err != nil {\n\t\treturn nil, err\n\t}\n\treader, err := s.client.Bucket(bucket).Object(object).NewReader(ctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to open object %q in bucket %q: %w\", object, bucket, err)\n\t}\n\tdefer reader.Close()\n\n\tflags := os.O_WRONLY | os.O_CREATE\n\tif overwrite {\n\t\tflags |= os.O_TRUNC\n\t} else {\n\t\tflags |= os.O_EXCL\n\t}\n\tf, err := os.OpenFile(destination, flags, 0o644)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrExist) {\n\t\t\treturn nil, fmt.Errorf(\"destination %q: %w\", destination, cloudstoragecommon.ErrDestinationExists)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to open destination %q: %w\", destination, err)\n\t}\n\n\tn, err := io.Copy(f, reader)\n\tif err != nil {\n\t\t_ = f.Close()\n\t\treturn nil, fmt.Errorf(\"failed to write object %q to %q: %w\", object, destination, err)\n\t}\n\tif err := f.Close(); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to close destination %q: %w\", destination, err)\n\t}\n\n\treturn map[string]any{\n\t\t\"destination\": destination,\n\t\t\"bytes\":       n,\n\t\t\"contentType\": reader.Attrs.ContentType,\n\t}, nil","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/cloudstorage/cloudstorage.go#L418-L454","documentation":"Error \"destination %q: %w\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/cloudstorage/cloudstorage.go:436 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}