PHPackages                             rhumsaa/vnderror - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. rhumsaa/vnderror

Abandoned → [ramsey/vnderror](/?search=ramsey%2Fvnderror)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

rhumsaa/vnderror
================

application/vnd.error builder / formatter for PHP 5.3+

3.0.2(3y ago)1788.6k↓25%7[1 PRs](https://github.com/ramsey/vnderror/pulls)MITPHPPHP &gt;=5.3.3

Since Jul 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/ramsey/vnderror)[ Packagist](https://packagist.org/packages/rhumsaa/vnderror)[ Docs](https://github.com/ramsey/vnderror)[ RSS](/packages/rhumsaa-vnderror/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

ramsey/vnderror
===============

[](#ramseyvnderror)

[![Build Status](https://camo.githubusercontent.com/aad610a20895b4345f1c6690a093666f6b4b5640838c8bfb2db6769f56128992/68747470733a2f2f7472617669732d63692e6f72672f72616d7365792f766e646572726f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ramsey/vnderror)[![Coverage Status](https://camo.githubusercontent.com/aa4db0cda23db8616db44bdfc7178e557b3d27ee128a7168bbbcf0b1fa8e8da5/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f72616d7365792f766e646572726f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/ramsey/vnderror)[![Latest Stable Version](https://camo.githubusercontent.com/a5009cf5ef1614f65cf53ee96f168d306cec9b7c686b5ae06fbfed9e97a145ad/68747470733a2f2f706f7365722e707567782e6f72672f72616d7365792f766e646572726f722f762f737461626c652e737667)](https://packagist.org/packages/ramsey/vnderror)[![Total Downloads](https://camo.githubusercontent.com/44d7af860a335ed7a99607516e80b775b96d4d0b9559ec14052ee4ab542f7abe/68747470733a2f2f706f7365722e707567782e6f72672f72616d7365792f766e646572726f722f646f776e6c6f6164732e737667)](https://packagist.org/packages/ramsey/vnderror)[![Latest Unstable Version](https://camo.githubusercontent.com/8b40ff3c0e95897065441208f4e4772709d95639e58b0ce25cfd6c05b2e680e1/68747470733a2f2f706f7365722e707567782e6f72672f72616d7365792f766e646572726f722f762f756e737461626c652e737667)](https://packagist.org/packages/ramsey/vnderror)[![License](https://camo.githubusercontent.com/2d3a92a285d538bb5f2ca7a329a34169ba2ea564ed7f891195191d67894b8a0c/68747470733a2f2f706f7365722e707567782e6f72672f72616d7365792f766e646572726f722f6c6963656e73652e737667)](https://packagist.org/packages/ramsey/vnderror)

Ramsey\\VndError is a PHP implementation of the [vnd.error](https://github.com/blongden/vnd.error) specification. This implementation currently targets the [e88d5cd1ad](https://github.com/blongden/vnd.error/blob/e88d5cd1ad467b653573471f0c859428bddaece8/README.md) revision of the specification.

From the vnd.error specification:

> vnd.error is a simple way of expressing an error response in XML or JSON.
>
> Often when returning a response to a client a response type is needed to represent a problem to the user (human or otherwise). A media type representation is a convenient way of expressing the error in a standardised format and can be understood by many client applications.

Examples
--------

[](#examples)

Use `application/vnd.error+json` or `application/vnd.error+xml` media types to communicate errors with HTTP 4xx and 5xx status codes.

```
use Ramsey\VndError\VndError;

$vndError = new VndError('Validation failed', 42);
$vndError->addLink('help', 'http://.../', array('title' => 'Error Information'));
$vndError->addLink('describes', 'http://.../', array('title' => 'Error Description'));
```

### JSON output (application/vnd.error+json):

[](#json-output-applicationvnderrorjson)

```
header('Content-Type: application/vnd.error+json');
echo $vndError->asJson();
```

Results in:

```
{
    "message": "Validation failed",
    "logref": 42,
    "_links": {
        "help": {
            "href": "http://.../",
            "title": "Error Information"
        },
        "describes": {
            "href": "http://.../",
            "title": "Error Description"
        }
    }
}
```

### XML output (application/vnd.error+xml)

[](#xml-output-applicationvnderrorxml)

```
header('Content-Type: application/vnd.error+xml');
echo $vndError->asXml();
```

Results in:

```

    Validation failed

```

Installation
------------

[](#installation)

The preferred method of installation is via [Composer](https://getcomposer.org/):

```
php composer.phar require ramsey/vnderror
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~958 days

Total

5

Last Release

1220d ago

Major Versions

1.0.0 → 2.0.02014-02-26

2.0.0 → 3.0.02015-03-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/f514481fa9cfdfd5dbcaccb3e5b480f18ea05ebf331cddf9b1c5a2a96a78fef5?d=identicon)[ramsey](/maintainers/ramsey)

---

Top Contributors

[![ramsey](https://avatars.githubusercontent.com/u/42941?v=4)](https://github.com/ramsey "ramsey (23 commits)")

---

Tags

apierrorhacktoberfestphpjsonrestxmlerrorhypermedia

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rhumsaa-vnderror/health.svg)

```
[![Health](https://phpackages.com/badges/rhumsaa-vnderror/health.svg)](https://phpackages.com/packages/rhumsaa-vnderror)
```

###  Alternatives

[nocarrier/hal

application/hal builder / formatter for PHP 5.3+

2032.0M21](/packages/nocarrier-hal)[tcdent/php-restclient

A generic REST API client for PHP

3542.9M29](/packages/tcdent-php-restclient)[crell/api-problem

PHP wrapper for the api-problem IETF specification

2482.0M20](/packages/crell-api-problem)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69114.3k](/packages/serpapi-google-search-results-php)[hgg/pardot

Pardot API library for building custom CRM connectors

2399.6k](/packages/hgg-pardot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
